Hypothesis test involving multiple proportions.

249 Views Asked by At

I flip three coins 100 time, and each time I flip them, I record the number of heads showing. The number of times that 0, 1, 2, or 3 heads showed was 33, 35, 24, and 8, respectively. I want to test whether it is reasonable to assume that the coins are fair using significance level of 0.05.

I am denoting the probability of getting heads on each respective coin as $\theta_i$ for $i=1,2,3$. I have $H_0:\theta_1=\theta_2=\theta_3=\frac12$ and $H_1:$ At least one of $\theta_1,\theta_2,\theta_3$ is not $\frac12$. Under the assumption of the null hypothesis, I believe that $X=$ number of heads showing has a distribution that is Binomial$(n,\theta=\frac12)$. I believe that I need to figure out the expected frequency of each of the four possibilities, but then once I find these, I'm not really sure what to do. Any suggestions?

1

There are 1 best solutions below

0
On BEST ANSWER

You want to see if your observed counts $X = (33, 35, 24, 8)$ of getting $ i =0, 1, 2, 3$ heads in $n=100$ trials are consistent with $\mathsf{Binom}(3, 1/2),$ which has probabilities $p = (1/8,\, 3/8,\, 3/8,\, 1/8),$ respectively of giving those counts. Thus according to the binomial model the expected counts are $E = np = (100/8,\, 300/8,\, 300/8,\, 100/8).$

Then you need to do the required chi-squared goodness-of-fit test of the null hypothesis that the correct model is $\mathsf{Binom}(3, 1/2)$ against the alternative that this is not the correct model. The test statistic

$$Q = \sum_{i = 0}^3 \frac{(X_i - E_i)^2}{E_i}$$

is approximately distributed as $\mathsf{Chisq}(4-1 = 3),$ rejecting if $Q > 7.815.$

The computed value of the test statistic is $Q = 39.75 > 7.815,$ so we reject the null hypothesis, and say that the observed counts are not consistent with $\mathsf{Binom}(3, 1/8).$ The P-value of this test is $1.2 \times 10^{-8},$ which is the probability that fair coins would produce a goodness-of-fit statistic as large as $39.75.$

Computations in R statistical software are as shown below. Perhaps you can verify them on a calculator and using printed tables of the chi-squared distribution.

i = 0:3;  p = dbinom(i, 3, .5)
x = c(33, 36, 24, 8);  n = sum(x);  e = n*p
q = sum((x-e)^2/e);  q
## 39.75248
qchisq(.95, 3)
## 7.814728
1 - pchisq(q, 3)
## 1.202324e-08

Here is a plot of the density curve of $\mathsf{Chisq}(3),$ with a vertical dotted line at the critical value 7.815; the observed value 39.75 is far off the graph to the right.

enter image description here

Notes: (1) Another way to look at these data (roughly along the lines of the Comment by @lulu) is that the number of Heads in 300 tosses is $Y = 3(8) + 2(24) + 35 = 107,$ where the assumption is that $Y \sim \mathsf{Binom}(300, 1/2).$ However $P(Y \le 107) = 3.9 \times 10^{-7}.$ So getting only 107 or fewer heads in 300 tosses of a fair coin is almost impossible. (This P-value is an exact probability, so it does not precisely match the approximate P-value from the chi-squared test.)

pbinom(107, 300, 1/2)
## 3.908212e-07

(2) I don't see how an ANOVA test procedure is appropriate for working this problem.