Displaying 20 results from an estimated 800 matches similar to: "small bug in binom.test?"
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
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)
2006 Oct 11
2
expression as a parameter of binom.test (PR#9288)
Full_Name: Petr Savicky
Version: 2.4.0
OS: Fedora Core release 2
Submission from: (NULL) (62.24.91.47)
the error is
> binom.test(0.56*10000,10000)
Error in binom.test(0.56 * 10000, 10000) :
'x' must be nonnegative and integer
while
> binom.test(5600,10000)
yields correct result.
The same error occurrs for
> binom.test(0.57*10000,10000)
2002 Sep 22
3
binom.test()
Hello everybody.
Does anyone else find the last test in the following sequence odd?
Can anyone else reproduce it or is it just me?
> binom.test(100,200,0.13)$p.value
[1] 2.357325e-36
> binom.test(100,200,0.013)$p.value
[1] 6.146546e-131
> binom.test(100,200,0.0013)$p.value
[1] 1.973702e-230
> binom.test(100,200,0.00013)$p.value
[1] 0.9743334
(R 1.5.1, Linux RedHat 7.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
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]
>
1999 Jan 28
1
bug in the ctest package: binom.test
R 0630 for windows
> library(ctest)
> binom.test(7,10,p=0.3, alternative="two.sided")
returns a p-value of =< 2.2e-016 and a warning
In Splus 3.4
> binom.test(7,10,p=0.3, alternative="two.sided")
returns a p-value of 0.0106
I think it is the
max(v[v<=(1+eps)*PVAL]) causing the problem...
max() of an empty vector.......
Mai Z
2009 Feb 05
1
Incorrect p value for binom.test?
I believe the binom.test procedure is producing one tailed p values
rather than the two tailed value implied by the alternative hypothesis
language. A textbook and SAS both show 2*9.94e-07 = 1.988e-06 as the
two tailed value. As does the R summation syntax from R below. It
looks to me like the alternative hypothesis language should be revised
to something like " ... greater than or equal
2008 May 29
1
Accessing Value of binom.test
With this line:
> binom.test(x=12, n=50, p=12/50, conf.level = 0.90)
I get this output:
> Exact binomial test
>
> data: 12 and 50
> number of successes = 12, number of trials = 50, p-value = 1
> alternative hypothesis: true probability of success is not equal to 0.24
> 90 percent confidence interval:
> 0.1447182 0.3596557
> sample estimates:
> probability
2001 Jun 08
1
binom.test appropriate?
Hi there,
as part of a 2 x 2 contingency table analysis I would like to estimate
conditional probabilities (success rates) in a Bernoulli
experiment. In particular I want to test a null hypothesis p <= p0
versus the alternative hypothesis p > p0.
As far as I understand the subject, there are UMPU tests for these
types of hypotheses.
Now I know about R's "binom.test" but the
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
2006 Jul 04
1
problem getting R 2.3.1 svn r38481 to pass make check-all
Hi,
I noticed this problem on my home desktop running FC4 and again on my
laptop running FC5. Both have previously compiled and passed make
check-all on 2.3.1 svn revisions from 10 days ago or so. On both these
machines, make check-all is consistently failing (4 out of 4 attempts on
the FC 4 desktop and 3 out of 3 on the FC 5 laptop) in the
p-r-random-tests tests. This is with both default
2010 Dec 13
1
Testing an interaction with a random effect in lmer
Hi,
I was hoping to get some advice regarding the testing of interactions, when one factor is modelled as a random effect...
I have a model with binomial error structure where the response variable is the proportion of time spent at the main sett (animals were tracked for 28 consecutive days in each season, and were recorded either at the main sett or an outlier sett, so the response variable is
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
2009 Jan 05
2
Sweave data-figure coupling
Hi,
With the following Sweave minimal file:
---<--------------------cut here---------------start------------------->---
\documentclass{article}
\usepackage{Sweave}
\begin{document}
<<binom-sim>>=
thetas <- seq(0, 1, by=0.001)
prior <- rep(1, length(thetas)) / length(thetas)
lik <- dbinom(1, 1, thetas)
lik.p <- prior * lik
post <- lik.p / sum(lik.p)
2006 Jun 29
1
using "rbinom" in C code gives me erroneous results... random variable is not random (always zero)...
Dear Listers,
I am trying to use "rbinom" in my C code, but i always get zeros as output no matter the probability. Am not sure what I am doing wrong because the function has worked before. Attached in an example. Noticed that "rbinom" expects 'n' to be REAL.
Regards, Vumani
R 2.3.1 (2006-06-01)
Windows XP
Gcc
/* Called this file binom.c and then ran rcmd shlib on it
2007 Aug 02
1
simulate() and glm fits
Dear All,
I have been trying to simulate data from a fitted glm using the simulate()
function (version details at the bottom). This works for lm() fits and
even for lmer() fits (in lme4). However, for glm() fits its output does
not make sense to me -- am I missing something or is this a bug?
Consider the following count data, modelled as gaussian, poisson and
binomial responses:
counts
2000 Jun 15
1
proportions - finite population correction
> Dear R-users!
>
> I am using R 1.0.0 and Windows NT 4.0.
>
Suppose I have a population of N=100 subjects, a binomial variable and a
random sample of n=20 subjects from my population, giving 15 "successes". I
am interested in obtaining a confidence interval for the proportion of
"successes" in my population.
In R, I can use
> library(ctest)
>