In: Statistics and Probability
Suppose a coin is tossed 100 times and the number of heads are recorded. We want to test whether the coin is fair. Again, a coin is called fair if there is a fifty-fifty chance that the outcome is a head or a tail. We reject the null hypothesis if the number of heads is larger than 55 or smaller than 45.
Write your H_0 and H_A in terms of the probability of heads, say p.
Find the Type I error rate if the null hypothesis is true.
Calculate the power of the test if the true chance of head is 0.4
Find the p-value if the observed number of heads is 65.
Null Hypothesis H0: p = 0.5
Alternative hypothesis HA: p 0.5
Standard error of sample proportion = = 0.05
We reject the null hypothesis if the number of heads is larger than 55 or smaller than 45.
Type I error rate = Probability to reject the null hypothesis when it is true
= P(p < 0.45 | p = 0.5) + P(p > 0.55 | p = 0.5)
= P[Z < (0.45 - 0.5) / 0.05] + P[Z > (0.55 - 0.5) / 0.05]
= P[Z < -1] + P[Z > 1]
= 0.1587 + 0.1587
= 0.3174
Standard error of sample proportion for p =0.4 = = 0.049
Power of the test if the true chance of head is 0.4 = Probability to reject the null hypothesis when p = 0.4
= P(p < 0.45 | p = 0.4) + P(p > 0.55 | p = 0.4)
= P[Z < (0.45 - 0.4) / 0.049] + P[Z > (0.55 - 0.4) / 0.049]
= P[Z < 1.02] + P[Z > 3.06]
= 0.8461 + 0.0011
= 0.8472
If the observed number of heads is 65, sample proportion, = 65/00 = 0.65
Test statistic, z = ( - p) / Std error = (0.65 - 0.5) / 0.05 = 3
For two tail test, p-value = 2 * P(z > 3) = 0.0027