Chi-squared test of homogeneity

155 Views Asked by At

I have a question about this problem related to a Chi-squared test.

For professor B, how do they come up with 3 degrees of freedom? Also, what test statistic did they use? I'm not really sure what they were testing.

enter image description here

1

There are 1 best solutions below

0
On

For B: there are $k = 4$ categories with observed frequencies $X = (19,10,9,21).$ Under $H_0$ that all categories are equally likely all expected cell counts are $E = 59/4.$ Then $Q = \sum_{i=1}^4 (X_i - E)^2/E$ is approximately distributed as $Chisq(df = k-1 = 3).$ But $Q = 7.644$ does not (quite) exceed the critical value 7.815 for a test at the 5% level. So we cannot use the current data to establish that Prof B is wrong (using the 5% level of significance). Good for him that we're not using the 6% level.

 X = c(19, 10, 9, 21);  E = 59/4
 Q = sum((X-E)^2/E);  Q
 ## 7.644068
 qchisq(.95, 3)
 ## 7.814728           # 5% critical value
 qchisq(.94, 3)
 ## 7.40688            # 6% critical value
 1 - pchisq(Q, 3)
 ## 0.05397002         # P-value of Prof B's test