Displaying 20 results from an estimated 1000 matches similar to: "pbinom with size argument 0 (PR#8560)"
2000 Dec 14
2
Accuracy problem in dchisq for non-central chi-squared
Hi,
I think I have identified a inaccuracy in dchisq when the non-centrality
parameter is non-zero and large. Here's a little test:
sys.dchisq.test <- function(N = 100000,mean = 0)
{
z <- rnorm(N,mean = mean, sd = 1)
x <- z^2
xmin <- min(x)
xmax <- max(x)
br <- seq(xmin,xmax,length = 101)
dbr <- br[2]-br[1]
hist(x,br)
p <- dchisq(br,df = 1,ncp =
2001 Oct 10
4
Weird feature when creating function lists with apply
Hi R-fellows,
can anyone explain this weird feature? I am trying to create a list of
functions with apply, and it appears that there is something strange going
on when the function evaluates the argument a. When I duplicate a into a
local variable b, the result changes !?!
Any pointers? Thank in advance. Cheers,
Uffe
# Create a function which returns a function
> f1 <- function(a)
2012 Aug 20
1
The difference between chisq.test binom.test and pbinom
Hello all,
I am trying to understand the different results I am getting from the
following 3 commands:
chisq.test(c(62,50), p = c(0.512,1-0.512), correct = F) # p-value = 0.3788
binom.test(x=62,n=112, p= 0.512) # p-value = 0.3961
2*(1-pbinom(62,112, .512)) # p-value = 0.329
Well, the binom.test was supposed to be "exact" and give the same results
as the pbinom, while the chisq.test
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
2006 Oct 19
5
binom.test
R-experts:
A quick question, please.
>From a lab exp, I got 12 positives out of 50.
To get 90% CI for this , I think binom.test might be the one to be used.
Is there a better way or function to calculate this?
> binom.test(x=12, n=50, p=12/50, conf.level = 0.90)
Exact binomial test
data: 12 and 50
number of successes = 12, number of trials = 50, p-value = 1
alternative
2007 Apr 05
1
binom.test() query
Hi Folks,
The recent correspondence about "strange fisher.test result",
and especially Peter Dalgaard's reply on Tue 03 April 2007
(which I want to investigate further) led me to take a close
look at the code for binom.test().
I now have a query!
The code for the two-sided case computes the p-value as follows:
if (p == 0) (x == 0)
else
if (p == 1) (x == n)
2002 Mar 22
1
binom.test and small N
running R 1.4.1 on MAC and 1.2.2 on Linux
When I use run binom.test with small N the results are a little
perplexing to me
>binom.test(9,20,p=0.5)
gives the below plus other stuff
95 percent confidence interval:
0.2305779 0.6847219
Now:
>pbiom(9,20,0.6847219)
[1] 0.02499998 # i.e., lower 2.5% of distribution
>pbinom(9,20,0.2305779)
[1] 0.9923132
>pbinom(8,20,0.2305779)
2010 Mar 13
1
What can I use instead of ks.test for the binomial distribution ?
Hello all,
A friend just showed me how ks.test fails to work with pbinom for small
"size".
Example:
x<-rbinom(10000,10,0.5)
x2<-rbinom(10000,10,0.5)
ks.test(x,pbinom,10,0.5)
ks.test(x,pbinom,size = 10, prob= 0.5)
ks.test(x,x2)
The tests gives significant p values, while the x did come from
binom with size = 10 prob = 0.5.
What test should I use instead ?
Thanks,
Tal
2007 Jul 03
3
generating correlated Bernoulli random variables
Hi all,
I was wondering how to generate samples for two RVs X1 and X2.
X1 ~ Bernoulli (p1)
X2 ~ Bernoulli (p2)
Also, X1 and X2 are correlated with correlation \rho.
Regards,
Vineet
[[alternative HTML version deleted]]
2006 Mar 22
4
pbinom( ) function (PR#8700)
Full_Name: Chanseok Park
Version: R 2.2.1
OS: RedHat EL4
Submission from: (NULL) (130.127.112.89)
pbinom(any negative value, size, prob) should be zero.
But I got the following results.
I mean, if a negative value is close to zero, then pbinom() calculate
pbinom(0, size, prob). dbinom() also behaves similarly.
> pbinom( -2.220446e-22, 3,.1)
[1] 0.729
> pbinom( -2.220446e-8, 3,.1)
2000 Oct 02
2
binom.test bug?
R. 1.1.0
The example below is self explanatory.
## 1 ## # works fine
> binom.test((50*.64),50,.5,alt='g')
... Exact binomial test ...
## 2 ## # WHAT ! ?
> binom.test((50*.65),50,.5,alt='g')
Error in binom.test((50 * 0.65), 50, 0.5, alt = "g") :
x must be an
2005 Feb 11
1
Re: [R-SIG-Mac] Bug running pbinom() in R-GUI?
On Feb 10, 2005, at 7:38 PM, George W. Gilchrist wrote:
> Today I was running a graduate level stats lab using R and we
> encountered a
> major problem while using the current build of the Cocoa GUI:
>
>> From the GUI:
>> system.time(pbinom(80, 1e5, 806/1e6))
> [1] 14.37 4.94 30.29 0.00 0.00
>>
>
>> From the command line on the same machine:
>>
2005 Aug 27
2
two-tailed exact binomail test
I am trying to find a definition for the two-tailed exact binomial test but have been unsuccessful. Can you help?
---------------------------------
[[alternative HTML version deleted]]
2002 May 17
0
pbinom gotcha (PR#1569)
This came up due to a question from Anders Hald:
Bernoulli calculated an approximation to the smallest n so that
P(0.58 <= x/n <= 0.62) >= 1000/1001
What is the exact value?
Now try
n <- 6350:6500
Pr <- function(n)pbinom(0.62*n,n,0.6) -
pbinom(0.58*n,n,0.6) + dbinom(0.58*n,n,0.6)
plot(n,Pr(n),type="b")
abline(h=1000/1001)
min(n[Pr(n)>1000/1001])
Next, try
Pr
2005 Feb 23
1
Re: [R-SIG-Mac] Bug running pbinom() in R-GUI?
The real problem is that pbeta can take forever. That's bug #7153 and a fix is
within reach.
Morten
2001 Jun 09
1
AW: binom.test appropriate?
No,
since I'd like to test
null: p <= p0
alternative: p > p0.
and my understanding is that binom.test tests
null: p = p0 (can only be a "simple" null hypothesis
according to help(binom.test))
alternative: p > p0 (or p < p0 or p != p0).
Thanks, Mirko.
> -----Urspr?ngliche Nachricht-----
> Von: Douglas Bates [mailto:bates at stat.wisc.edu]
>
2006 Dec 17
1
fischer.test help
Um texto embutido e sem conjunto de caracteres especificado associado...
Nome: n?o dispon?vel
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20061217/91002ee1/attachment.pl
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?
2009 Mar 28
1
Error in R??
Can someone explain why I am getting the following error: in the r code
below?
Error in solve.default(diag(2) + ((1/currvar) * (XX1 %*% t(XX1)))) :
system is computationally singular: reciprocal condition number = 0
In addition: There were 50 or more warnings (use warnings() to see the first
50)
The R code is part of a bigger program.
##sample from full conditional
1998 Jun 30
0
R-beta: Re: [S] pbinom
Btw,
all the pbinom() examples posted to S-news today
return the proper result in R
Martin
>>>>> "JS" == James Stapleton <stapleton at stt.msu.edu> writes
to S-news :
JS> More interesting behavior of pbinom:
>> pbinom(3,2,.8)
JS> [1] 1
>> pbinom(30,2,.8)
JS> [1] 0.9967653
>> pbinom(40,2,.8)
JS> [1]