Displaying 20 results from an estimated 88 matches for "pbinom".
Did you mean:
dbinom
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)
[1] 0.729...
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,...
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 relies on the normal asymptotics. So I
would imagine the binom.test should be equal to one of the other two lines,
but it is not.
The same happ...
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 <- function(n)pbinom(0.62*n,n,0.6) -
pbinom(0.58*n + 1e-7,n,0.6) + dbinom(0.58*n,n,0.6)
plot(n,Pr(n),type="b")
abline(...
2008 Aug 05
1
optimize simultaneously two binomials inequalities using nlm( ) or optim( )
...used in
acceptance sampling) which are nonlinear solution, so there is no simple
direct solution. Please, let me explain shortly the the problem and the
question as following.
The objective is to obtain the smallest value of 'n' (sample size)
satisfying both inequalities:
(1-alpha) <= pbinom(c, n, p1) && pbinom(c, n, p2) <= beta
Where p1 (AQL) and p2 (LTPD) are probabilities parameters (Consumer and
Producer), the alpha and beta are conumer and producer risks, and finally,
the 'n' represents the sample size and the 'c' an acceptance number or
maximum number...
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:
>> system.time(pbinom(80, 1e5, 806/1e6))
> [1] 0.02 0.00 0.02 0.00 0.00
>>
>
> I've tried the CRAN version and the latest build of the R-GUI and both...
2000 Apr 07
4
Bug in qbinom? (PR#511)
n_10;p_0.5;jjx_0:n;qbinom(pbinom(jjx,n,p),n,p) # This one works as
expected
n_100;p_0.5;jjx_0:n;qbinom(pbinom(jjx,n,p),n,p) # This one causes
severe problems
I cannot interrupt using ESC and I finally have to resort to the Windows
Task manager to kill the R session.
A friend of mine told me that he faced similar problems under...
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
2006 Feb 03
5
pbinom with size argument 0 (PR#8560)
Full_Name: Uffe H?gsbro Thygesen
Version: 2.2.0
OS: linux
Submission from: (NULL) (130.226.135.250)
Hello all.
pbinom(q=0,size=0,prob=0.5)
returns the value NaN. I had expected the result 1. In fact any value for q
seems to give an NaN. Note that
dbinom(x=0,size=0,prob=0.5)
returns the value 1.
Cheers,
Uffe
2003 Feb 14
0
FW: [Fwd: Re: [S] Exact p-values]
...M]
> Sent: Friday, February 14, 2003 1:29 PM
> To: Stratowa,Dr,Christian FEX BIG-AT-V
> Cc: r-help at stat.math.ethz.ch; David Smith
> Subject: Re: [R] FW: [Fwd: Re: [S] Exact p-values]
>
> To understand the correct answer, you need to understand the following:
>
> > pbinom(1, 2, .5)
> [1] 0.75
>
> This is the binomial cumulative distribution function.
> *** pbinom(0, 2, .5) = 0.25
> *** pbinom(1, 2, .5) = 0.75 = 0.25 + 0.5
> *** pbinom(2, 2, .5) = 1
>
> However, pbinom(1e15, 2e15, .5) is a computational challenge. Standard
> numerical a...
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 inst...
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
2003 Feb 14
1
FW: [Fwd: Re: [S] Exact p-values]
Dear all
Just for fun, I have just downloaded the paper mentioned below and checked
it with R-1.6.1.
Everything is ok with exception of Table 2b, where I get always 1 instead of
0.5:
> pbinom(1e15,2e15,0.5)
[1] 1
Which value should be correct?
Best regards
Christian Stratowa
==============================================
Christian Stratowa, PhD
Boehringer Ingelheim Austria
Dept NCE Lead Discovery - Bioinformatics
Dr. Boehringergasse 5-11
A-1121 Vienna, Austria
Tel.: ++43-1-80105-2470...
2001 Jul 01
0
ks.test doesn't compute correct empirical distribution if there are ties in the data (PR#1007)
...est should work (both quite possible)...
>
>
>Thanks,
>JT..
>
>
>
>> #### 1000 random samples from binomial dist with mean =.25, n=100...
>> o<-rbinom (1000, 100, .25)
>> mean (o);
>[1] 25.178
>> var (o);
>[1] 19.61193
>> ks.test (o, "pbinom", 100, .25);
>
> One-sample Kolmogorov-Smirnov test
>
>data: o
>D = 0.0967, p-value = 1.487e-08
>alternative hypothesis: two.sided
>
>
>
>p-value is mighty small, leading me to reject the null hypothesis that
>the sample has been drawn from the Bin(1...
2007 Apr 05
1
binom.test() query
...lt;- 1 + 1e-07
d <- dbinom(x, n, p)
m <- n * p
if (x == m) 1
else
## PVAL if x < m
if (x < m) {
i <- seq(from = ceiling(m), to = n)
y <- sum(dbinom(i, n, p) <= d * relErr)
## here:
pbinom(x,n,p) + pbinom(n-y,n,p,lower=FALSE)
}
## PVAL if x > m:
else {
i <- seq(from = 0, to = floor(m))
y <- sum(dbinom(i, n, p) <= d * relErr)
## here:
pbinom(y-1,n,p) + pbinom(x-1,n,p,lower=FALSE)
}
}...
2002 Mar 22
1
binom.test and small N
...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)
[1] 0.975 # i.e., upper 2.5% of distribution
I would think I generally want a 95% CI on the observed 9 out of 20,
not 8 out of 20 LB and 9 out of 20 UB. I am missing something or is
this strictly a function of the beta approximatio...
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
2001 Jul 01
1
(PR#1007) ks.test doesn't compute correct empirical
...Thanks,
> >JT..
> >
> >
> >
> >> #### 1000 random samples from binomial dist with mean =.25, n=100...
> >> o<-rbinom (1000, 100, .25)
> >> mean (o);
> >[1] 25.178
> >> var (o);
> >[1] 19.61193
> >> ks.test (o, "pbinom", 100, .25);
> >
> > One-sample Kolmogorov-Smirnov test
> >
> >data: o
> >D = 0.0967, p-value = 1.487e-08
> >alternative hypothesis: two.sided
> >
> >
> >
> >p-value is mighty small, leading me to reject the null hypothesis th...
2004 Apr 30
1
Exact Binomial test feature or bug?
...) && is.finite
(conf.level) && (conf.level > 0) &&
(conf.level < 1)))
stop("conf.level must be a single
number between 0 and 1")
DNAME <- paste(deparse(substitute(x)), "and",
deparse(substitute(n)))
PVAL <- switch(alternative,
less = pbinom(x, n, p),
greater = 1 - pbinom(x - 1, n, p),
{
pvec <- pbinom(0:n, n, p)
if(x/n < p) {
pb <- pbinom(x, n, p)
p2 <- max((1 - pvec)
[pb - (1 - pvec) >= - eps * pb], 0)
min(1, pb + p2)
}
else {
pb <- (1 - pbinom(x -
1, n, p))
p2 <- max(pvec[pb...
2007 Sep 19
2
how to find "p" in binomial(n,p)
I think the function you need is 'help.search'; try:
help.search("binomial")
and look for something obvious in the 'stats' package. A good deal quicker
and easier than posting to an internet forum!
Cheers, Mike.
cathelf wrote:
>
> Dear all,
>
> I am trying a find the value "p" in binomial.
>
> X ~ Bin(n,p)
>
> I want to find the