1
$\begingroup$

Let's say I observe 10 people going in an alley and I find out 100 % are men. Since there are 50 % of men in population, I'd expect this to happen at random for every 1 in $$ \frac{1}{2^{10}}=0.00097 $$ cases. Is there a name for the test where this number would represent the p-value?

$\endgroup$
3
  • 3
    $\begingroup$ This is the p value of a one-sided exact binomial test. $\endgroup$
    – Michael M
    Commented Jul 5, 2021 at 15:54
  • 3
    $\begingroup$ To me this looks like a one-tailed exact binomial test. The p-value will be $P(X \geq 10 \mid \pi_0 = 0.5) = 2^{-10}$. Since the number of successes is equal to the sample size, $P(X = 10) = P(X \geq 10)$ en.wikipedia.org/wiki/Binomial_test $\endgroup$
    – jcken
    Commented Jul 5, 2021 at 15:57
  • 1
    $\begingroup$ to add the R code that produces 0.00097 as p-value: binom.test(x=10,n=10,p=0.5,alternative="greater") $\endgroup$
    – LuckyPal
    Commented Jul 5, 2021 at 15:59

1 Answer 1

1
$\begingroup$

The test (first) mentioned by @MichaelM is implemented in R as binom.test as follows:

binom.test(10, 10, alt="g")

        Exact binomial test

data:  10 and 10
number of successes = 10, number of trials = 10, 
  p-value = 0.0009766
alternative hypothesis: 
 true probability of success is greater than 0.5
95 percent confidence interval:
 0.7411344 1.0000000
sample estimates:
 probability of success 
                      1 

A similar test, using a normal approximation, is prop.test:

prop.test(10, 10, alte="g", cor=F)

        1-sample proportions test 
        without continuity correction

data:  10 out of 10, null probability 0.5
X-squared = 10, df = 1, p-value = 0.0007827
 alternative hypothesis: true p is greater than 0.5
95 percent confidence interval:
 0.787058 1.000000
sample estimates:
p 
1 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.