In: Statistics and Probability
The following table contains observed frequencies for a sample
of 200.  
| Column Variable | |||
| Row Variable | A | B | C | 
| P | 20 | 45 | 50 | 
| Q | 30 | 26 | 29 | 
Test for independence of the row and column variables
using  α = .05.  
Compute the value of the  Χ 2 test statistic (to
2 decimals).
The hypothesis to be tested here is:
H0: The row and the column variable are independent.
against the alternative hypothesis
H1: The ow and the column variable are not independent.
To test the independence of the row and the column variable we will use a chi-square test.
We have the following row and column totals:
| Column Variable | ||||
| Row Variable | A | B | C | Total | 
| P | 20 | 45 | 50 | 115 | 
| Q | 30 | 26 | 29 | 85 | 
| Total | 50 | 71 | 79 | 200 | 
The expected frequency in each cell is given as:

Thus we have the following table for expected frequencies:
| Column Variable | ||||
| Row Variable | A | B | C | Total | 
| P | 28.75 | 40.825 | 45.425 | 115 | 
| Q | 21.25 | 30.175 | 33.575 | 85 | 
| Total | 50 | 71 | 79 | 200 | 
The test statistic for the chi-square test is given as:

Putting the values we have:



The degrees of freedom is given by: 
 where r is the number of rows and c is the number of columns. So
here the degrees of freedom is 
.
The chi-square critical value at 0.05 level of significance and 2 degrees of freedom is 5.9915.
Since the calculated value of the test-statistic is more than the chi-square critical value so we have sufficient evidence to reject the null hypothesis. Thus we conclude that the row and the column variable are not independent.