In: Statistics and Probability
1. Chi-squared :
X Y Row Marginals
A: 60, 30, 90
B: 18, 40, 58
Column Marginal: 78, 70, 140
Solution:
Here, we have to use chi square test for independence of two categorical variables.
Null hypothesis: H0: Column and row variables are independent.
Alternative hypothesis: Ha: Column and row variables are not independent.
We assume level of significance = α = 0.05
Test statistic formula is given as below:
Chi square = ∑[(O – E)^2/E]
Where, O is observed frequencies and E is expected frequencies.
E = row total * column total / Grand total
We are given
Number of rows = r = 2
Number of columns = c = 2
Degrees of freedom = df = (r – 1)*(c – 1) = 1*1 = 1
α = 0.05
Critical value = 3.841459
(by using Chi square table or excel)
Calculation tables for test statistic are given as below:
| 
 Observed Frequencies  | 
|||
| 
 Column variable  | 
|||
| 
 Row variable  | 
 X  | 
 Y  | 
 Total  | 
| 
 A  | 
 60  | 
 30  | 
 90  | 
| 
 B  | 
 18  | 
 40  | 
 58  | 
| 
 Total  | 
 78  | 
 70  | 
 148  | 
| 
 Expected Frequencies  | 
|||
| 
 Column variable  | 
|||
| 
 Row variable  | 
 X  | 
 Y  | 
 Total  | 
| 
 A  | 
 47.43243  | 
 42.56757  | 
 90  | 
| 
 B  | 
 30.56757  | 
 27.43243  | 
 58  | 
| 
 Total  | 
 78  | 
 70  | 
 148  | 
| 
 Calculations  | 
|
| 
 (O - E)  | 
|
| 
 12.56757  | 
 -12.5676  | 
| 
 -12.5676  | 
 12.56757  | 
| 
 (O - E)^2/E  | 
|
| 
 3.329868  | 
 3.710425  | 
| 
 5.167037  | 
 5.757556  | 
Chi square = ∑[(O – E)^2/E] = 17.96489
P-value = 0.0000225
(By using Chi square table or excel)
P-value < α = 0.05
So, we reject the null hypothesis
There is sufficient evidence to conclude that Column and row variables are not independent.