In: Statistics and Probability
Sex |
Spring |
Summer |
Fall |
Winter |
Males |
163 |
135 |
71 |
43 |
Females |
86 |
77 |
40 |
48 |
Using chi-square, test the null hypothesis that the ratio of numbers of males to females was the same in all four seasons. (Use alpha = 0.05).
If you rejected the null in 1a, identify the season/seasons that has resulted in the rejection. What conclusion can you draw from your analysis? You may use R to conduct the sub-chi square tests.
Solution:
Here, we have to use chi square test for independence of two categorical variables.
Null hypothesis: H0: the ratio of numbers of males to females was the same in all four seasons.
Alternative hypothesis: Ha: the ratio of numbers of males to females was not same in all four seasons.
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 = 4
Degrees of freedom = df = (r – 1)*(c – 1) = 1*3 = 3
α = 0.05
Critical value = 7.814728
(by using Chi square table or excel)
Calculation tables for test statistic are given as below:
Observed Frequencies |
|||||
Column variable |
|||||
Row variable |
Spring |
Summer |
Fall |
Winter |
Total |
Males |
163 |
135 |
71 |
43 |
412 |
Females |
86 |
77 |
40 |
48 |
251 |
Total |
249 |
212 |
111 |
91 |
663 |
Expected Frequencies |
|||||
Column variable |
|||||
Row variable |
Spring |
Summer |
Fall |
Winter |
Total |
Males |
154.733 |
131.7406 |
68.97738 |
56.54902 |
412 |
Females |
94.26697 |
80.25943 |
42.02262 |
34.45098 |
251 |
Total |
249 |
212 |
111 |
91 |
663 |
Calculations |
|||
(O - E) |
|||
8.266968 |
3.259427 |
2.022624 |
-13.549 |
-8.26697 |
-3.25943 |
-2.02262 |
13.54902 |
(O - E)^2/E |
|||
0.441682 |
0.080642 |
0.059309 |
3.246315 |
0.724992 |
0.132369 |
0.097353 |
5.328613 |
Test Statistic = Chi square = ∑[(O – E)^2/E] = 10.11127
χ2 statistic = 10.11127
P-value = 0.017644
(By using Chi square table or excel)
P-value < α = 0.05
So, we reject the null hypothesis
There is not sufficient evidence to conclude that the ratio of numbers of males to females was the same in all four seasons.
The winter season that has resulted in the rejection because corresponding chi square contribution is more than other seasons.