Edit Problem


Power theory
|
Easy


A coin is thrown independently $10$ times to test the hypothesis that the probability of heads is $\frac{1}{2}$ versus the alternative that the probability is not $\frac{1}{2}$ . The test rejects if either $0$ or $ 10$ heads are observed.

(a) What is the significance level of the test?
(b) If, in fact, the probability of heads is $0.1$, what is the power of the test?

Answer:

$0.002, 0.349$

Solution:

This question is very similar to the concept check on power that you might have worked through.

The significance level is the false-rejection rate; or, the proportion of times this test will reject even though the null-hypothesis is true.

$${10 \choose 0} \frac{1}{2}^{10}\frac{1}{2}^{0} + {10 \choose 10} \frac{1}{2}^{0}\frac{1}{2}^{10} = 0.00195$$

If the coin actually has a probability of heads that is $0.1$, then the power of the test is the tests ability to reject at this probability of heads:

$${10 \choose 0} \frac{1}{10}^{10}\frac{9}{10}^{0} + {10 \choose 10} \frac{1}{10}^{0}\frac{9}{10}^{10} = 0.349$$

To me, this feels like something that we should consider plotting:

test_power <- function(prob_heads) {     (prob_heads^10) + ((1-prob_heads)^10)     }   probs <- seq(from=0, to=1, by=0.01)   powers <- test_power(probs)   plot(x=probs, y=powers, type='l')