Grades in a statistics course and an operations research course taken simultaneously were as follows for a group of students.

Statistics Grade/ Operation Research Grade A B C Other
A 25 6 17 13
B 17 16 15 6
C 18 4 18 10
Other 10 8 11 20

Are the grades in statistics and operations research related? Use $\alpha = 0.01$ in reaching your conclusion. What is the P-value for this test?

Solution

The observed data is

OR A OR B OR C OR Other Sum
ST A 25 6 17 13 61
ST B 17 16 15 6 54
ST C 18 4 18 10 50
ST Other 10 8 11 20 49
Sum 70 34 61 49 214

Number of rows $r=4$, number of coulmns $c=4$.

Step 1 The null and alternative hypothesis are as follows:

$H_0:$ The grades in Statistics and Operation Research are not related.

$H_1:$ The grades in Statistics and Operation Research are related.

Step 2 Test statistic:

The test statistic for testing above hypothesis is

$$ \begin{equation*} \chi^2= \sum \sum \frac{(O_{ij} -E_{ij})^2}{E_{ij}} \sim \chi^2_{(r-1)(c-1)}\\ \end{equation*} $$
Step 3 Level of Significance

The level of significance is $\alpha =0.01$.

Step 4 Critical value of $\chi^2$

The level of significance is $\alpha =0.01$. Degrees of freedom $df=(r-1)(c-1)=(4-1)(4-1) =9$.

The critical value of $\chi^2$ for $df=9$ and $\alpha=0.01$ level of significance is $\chi^2_{0.01,9} =21.666$.

Step 5 Computation of test Statistic

The expected frequency for $(i,j)^{th}$ cell is given by

$$ \begin{equation*} E_{ij} =\frac{i^{th}\text{ row total }\times j^{th}\text{ column total}}{N} \end{equation*} $$

For example, $E_{11}$ is given by

$$ \begin{eqnarray*} E_{11} & = &\frac{1^{st}\text{ row total }\times 1^{st}\text{ column total}}{N}\\ &=& \frac{61*70}{214}\\ &=&19.95. \end{eqnarray*} $$

Table of expected frequencies

OR A OR B OR C OR Other Sum
ST A 19.95 9.69 17.39 13.97 61.00
ST B 17.66 8.58 15.39 12.36 53.99
ST C 16.36 7.94 14.25 11.45 50.00
ST Other 16.03 7.79 13.97 11.22 49.01
Sum 70.00 34.00 61.00 49.00 214.00

The test statistic is

$$ \begin{eqnarray*} \chi^2&=& \sum \sum \frac{(O_{ij} -E_{ij})^2}{E_{ij}} \sim \chi^2_{(r-1)(c-1)}\\ &=&\frac{(25-19.95)^2}{19.95}+\cdots + \frac{(20-11.22)^2}{11.22}\\ &=& 25.5545. \end{eqnarray*} $$

Step 6 Decision (Traditional approach)
The test statistic is $\chi^2 =25.5545$ which falls $inside$ the critical region bonded by the critical value $\chi^2_{0.01,9}=21.666$, we $\textit{reject}$ the null hypothesis.

OR

Step 6 Decision ($p$-value approach)
The p-value is $P(\chi^2_{9}>25.5545) =0.00242$.

As the p-value $0.0024$ is $\textit{less than}$ the significance level of $\alpha = 0.01$, we $\textit{reject}$ the null hypothesis.

Further Reading