Displaying 20 results from an estimated 400 matches similar to: "Bug in qbinom? (PR#511)"
2009 May 20
3
qbinom (PR#13711)
Full_Name: Wolfgang Resch
Version: R 2.8.1 GUI 1.27
OS: OS X 10.4.11
Submission from: (NULL) (137.187.89.14)
Strange behavior of qbinom:
> qbinom(0.01, 5016279, 1e-07)
[1] 0
> qbinom(0.01, 5016279, 2e-07)
[1] 16
> qbinom(0.01, 5016279, 3e-07)
[1] 16
> qbinom(0.01, 5016279, 4e-07)
[1] 16
> qbinom(0.01, 5016279, 5e-07)
[1] 0
2005 Nov 23
1
qbinom returns NaN
Hi, All:
For most but not all cases, qbinom is the inverse of pbinom.
Consider the following example, which generates an exception:
> (pb01 <- pbinom(0:1, 1, .5, log=T, lower.tail=FALSE))
[1] -0.6931472 -Inf
Since "lower.tail=FALSE", Pr{X>1} = 0 in this context, and log(0) =
-Inf, consistent with the documentation.
However, the inverse of this does NOT
2007 Jun 28
2
inaccuracy in qbinom with partial argument matching
Hi,
I found the following strange effect with
qbinom & partial argument matching
p0 <- pbinom(0, size = 3, prob = 0.25)
qbinom(p0, size = 3, prob = 0.25) ## 0 o.k.
qbinom(p0-0.05, size = 3, prob = 0.25) ## 0 o.k.
## positional matching:
qbinom(p0, 3, 0.25) ## 0 o.k.
## partial argument matching:
qbinom(p0 , s = 3, p = 0.25) ## 1 ???
qbinom(p0-0.05,
2012 Nov 30
4
qbinom
a=c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9)
b=c(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1)
cor(a,b)= -1
a'=qbinom(a, 1, 0.5)
b'=qbinom(b, 1, 0.5)
why cor(a',b') becomes -0.5 ?
--
View this message in context: http://r.789695.n4.nabble.com/qbinom-tp4651460.html
Sent from the R help mailing list archive at Nabble.com.
2003 Dec 18
1
qbinom when probability is 1 (PR#5900)
Full_Name: Jonathan Swinton
Version: 1.8.0
OS: Windows 2000
Submission from: (NULL) (193.132.159.34)
Calling qbinom with a sample probability of 1 returns NaN
> qbinom(p=0.95,size=10,prob=1)
[1] NaN
I believe that this is wrong and that qbinom(p,size,prob=1) should always be
size for 0<p<=1.
The documentation says that
The quantile is defined as the smallest value x such that F(x)
2004 Jun 11
1
qbinom(p, size, prob = 0, lower.tail = FALSE) hangs (PR#6972)
Full_Name: Jon McAuliffe
Version: 1.9.0
OS: Mac OS X 10.3.4
Submission from: (NULL) (64.166.16.252)
a call like qbinom(0.3, 10, prob = 0, lower.tail = FALSE) hangs R. prob = 0 does
not
look interesting, but it can be useful for completeness when qbinom is part of
other general routines.
please see PR#5900 (Accuracy-fixed).
jon.
--please do not edit the information below--
Version:
2003 Sep 27
2
CI on median
Dear friends, I'm probably wrong but is there anything better than
bootstrap to get a confidence interval of the median from a population with
unspecified distribution ?
Best wishes
Troels Ring, Aalborg, Denmark
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the
order of the arguments. This is an example:
> rpois(n=1,lambda=2)
[1] 3
> rpois(lambda=2,n=1)
[1] 2 0
It obviously uses the first argument as the number of samples to be
drawn, which is wrong.
I used Version 0.49 Beta (April 23, 1997).
Fredrik
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the
order of the arguments. This is an example:
> rpois(n=1,lambda=2)
[1] 3
> rpois(lambda=2,n=1)
[1] 2 0
It obviously uses the first argument as the number of samples to be
drawn, which is wrong.
I used Version 0.49 Beta (April 23, 1997).
Fredrik
2003 Jan 22
2
small bug in binom.test?
Hi all,
I am wondering whether there is a small bug in the binom.test function of
the ctest library (I'm using R 1.6.0 on windows 2000, but Splus 2000 seems
to have the same behaviour). Or perhaps I've misunderstood something.
the command binom.test(11,100,p=0.1) and binom.test(9,100,p=0.1) give
different p-values (see below). As 9 and 11 are equidistant from 10, the
mean of the
2008 Aug 21
1
pnmath compilation failure; dylib issue?
(1) ...need to speed up a monte-carlo sampling...any suggestions about
how I can get R to use all 8 cores of a mac pro would be most useful
and very appreciated...
(2) spent the last few hours trying to get pnmath to compile under os-
x 10.5.4...
using gcc version 4.2.1 (Apple Inc. build 5553) as downloaded from
CRAN, xcode 3.0...
...xcode 3.1 installed over top of above after
2012 May 31
1
inverse binomial in R
Hello!
I'm having some trouble
trying to replicate in R a Stata function
invbinomial(n,k,p)
Domain n: 1 to 1e+17
Domain k: 0 to n - 1
Domain p: 0 to 1 (exclusive)
Range: 0 to 1
Description: returns the inverse of the cumulative binomial; i.e., it
returns the probability of success on one trial such
2002 Mar 12
1
rbinom silently rounds size argument (PR#1377)
rbinom (in R-1.4.1) silently rounds its "size" argument.
The C code contains
n = floor(nin + 0.5);
I would argue that this should this either be documented or changed (to
return NA). (The behavior is inconsistent with dbinom).
I sent this in to the devel list a couple of weeks ago to
provoke discussion; no disagreement (or agreement) so I'm
submitting it as a bug.
2000 Nov 16
2
newbee question
Dear All
Where can I lookup good methods to compute
p from q=bin(m,n)p^n*(1-p)^(m-n) such that
q<=alfa, alfa small. Are there such libs,
code and source in R?
Best Regards
--
Jan Burse SIAM, EAWAG
Scheuchzerstr. 67 ?berlandstr. 133
8006 Z?rich 8600 D?bendorf
tel: +41-1-364 17 66 tel: +41-1-823 55 34
2009 Mar 17
3
R does not compile any more on FreeBSD 8.0-CURRENT
On a recent FreeBSD 8.0-CURRENT (i386) building R (any version) breaks
with the following messages:
----------------------------------------------------------------------
[...snip...]
gcc -std=gnu99 -I. -I../../src/include -I../../src/include
-I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c wilcox.c -o wilcox.o
gcc -std=gnu99 -I. -I../../src/include -I../../src/include
-I/usr/local/include
2011 Nov 01
1
Sample size calculations for one sided binomial exact test
I'm trying to compute sample size requirements for a binomial exact test.
we want to show that the proportion is at least 90% assuming that it is
95%, with 80% power so any asymptotic approximations are out of the
questions. I was planning on using binom.test to perform the simple test
against a prespecified value, but cannot find any functions for computing
sample size. do any exist?
2023 Apr 08
1
Error message for infinite probability parameters in rbinom() and rmultinom()
On 08/04/2023 5:53 p.m., Martin Maechler wrote:
>>>>>> Christophe Dutang
>>>>>> on Sat, 8 Apr 2023 14:21:53 +0200 writes:
>
> > Dear all,
>
> > Using rmultinom() in a stochastic model, I found this function returns an error message 'NA in probability' for an infinite probability.
>
> > Maybe, a more
2000 Feb 19
1
problem with glm (PR#452)
I'm having sporadic problems with glm on my alpha workstation running
Compaq Tru64 UNIX V5.0 (I can't replicate the problem on my Linux PC). I
have the same problem whether I use a version of R built with the native
C-compiler or a version compiled with gcc. In both cases I've built with
g77.
I want to do some simulations with a call to glm in each rep. A simplified
version would be
1999 Jan 21
2
scoping problem?
Dear R-helpers: (this is part of a bigger program)
the following fails as a function, but runs OK
if we comment out the fnfn_ function() line.
Any hint would be appreciated. -Yudi-
R : Copyright 1998, The R Development Core Team
Version 0.63.0 Beta (Nov 13, 1998) -- on WIndows3.11
fnfn _ function (m=10,n=10,spar=2)
{
fn _ function(u,v){
uc_ u-floor(m/2)-1
vc_ v-floor(n/2)-1
2012 Sep 27
2
Generating an autocorrelated binary variable
Hi R-fellows,
I am trying to simulate a multivariate correlated sample via the Gaussian copula method. One variable is a binary variable, that should be autocorrelated. The autocorrelation should be rho = 0.2. Furthermore, the overall probability to get either outcome of the binary variable should be 0.5.
Below you can see the R code (I use for simplicity a diagonal matrix in rmvnorm even if it