In: Statistics and Probability
A poll classified respondents by gender and political party, as shown in the table. We wonder if there is evidence of an association between gender and party affiliation. (Assume a significance level of alpha=0.05)
D R I
Male 36 45 25
Female 51 38 13
calculate chi-square statistic x²=
Solution:
Here, we have to use chi square test for independence of two categorical variables.
Null hypothesis: H0: Two categorical variables are independent.
Alternative hypothesis: Ha: Two categorical variables are dependent.
We assume/given 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 = 3
Degrees of freedom = df = (r – 1)*(c – 1) = 1*2 = 2
α = 0.05
Critical value = 5.991465
(by using Chi square table or excel)
Calculation tables for test statistic are given as below:
| 
 Observed Frequencies  | 
||||
| 
 Column variable  | 
||||
| 
 Row variable  | 
 Democratic  | 
 Republic  | 
 Independent  | 
 Total  | 
| 
 Male  | 
 36  | 
 45  | 
 25  | 
 106  | 
| 
 Female  | 
 51  | 
 38  | 
 13  | 
 102  | 
| 
 Total  | 
 87  | 
 83  | 
 38  | 
 208  | 
| 
 Expected Frequencies  | 
||||
| 
 Column variable  | 
||||
| 
 Row variable  | 
 Democratic  | 
 Republic  | 
 Independent  | 
 Total  | 
| 
 Male  | 
 44.33653846  | 
 42.29807692  | 
 19.36538462  | 
 106  | 
| 
 Female  | 
 42.66346154  | 
 40.70192308  | 
 18.63461538  | 
 102  | 
| 
 Total  | 
 87  | 
 83  | 
 38  | 
 208  | 
| 
 Calculations  | 
||
| 
 (O - E)  | 
||
| 
 -8.33654  | 
 2.701923  | 
 5.634615  | 
| 
 8.336538  | 
 -2.70192  | 
 -5.63462  | 
| 
 (O - E)^2/E  | 
||
| 
 1.567508  | 
 0.172594  | 
 1.639466  | 
| 
 1.628979  | 
 0.179362  | 
 1.703759  | 
Test Statistic = Chi square = ∑[(O – E)^2/E] = 6.891667643
χ2 = 6.891667643
P-value = 0.03187817
(By using Chi square table or excel)
P-value < α = 0.05
So, we reject the null hypothesis
There is sufficient evidence to conclude that there is an association between gender and party affiliation.