Chi Square Test Lecture Note Final 2018
Chi Square Test Lecture Note Final 2018
Chi Square Test Lecture Note Final 2018
1
Contingency Tables
Age
Gender 16 – 20 21 – 30 31 – 40 41 – 50 51 – 60 61 and older
Male 32 51 52 43 28 10
Female 13 22 33 21 10 6
3
Expected Frequency
Example:
Find the expected frequency for each “Male” cell in the
contingency table for the sample of 321 fatally injured drivers.
Assume that the variables, age and gender, are independent.
Age
Gender 16 – 20 21 – 30 31 – 40 41 – 50 51 – 60 61 and Total
older
Male 32 51 52 43 28 10 216
Female 13 22 33 21 10 6 105
Total 45 73 85 64 38 16 321
4
Expected Frequency
Example continued:
Age
Gender 16 – 20 21 – 30 31 – 40 41 – 50 51 – 60 61 and Total
older
Male 32 51 52 43 28 10 216
Female 13 22 33 21 10 6 105
Total 45 73 85 64 38 16 321
(Sum of row r ) (Sum of column c )
Expected frequency E r ,c
Sample size
5
Chi-Square Independence Test
6
Chi-Square Independence Test
Example:
The following contingency table shows a random sample
of 321 fatally injured passenger vehicle drivers by age and
gender. The expected frequencies are displayed in
parentheses. At = 0.05, can you conclude that the
drivers’ ages are related to gender in such accidents?
Age
Gender 16 – 20 21 – 30 31 – 40 41 – 50 51 – 60 61 and Total
older
Male 32 51 52 43 28 10 216
(30.28) (49.12) (57.20) (43.07) (25.57) (10.77)
Female 13 22 33 21 10 6 105
(14.72) (23.88) (27.80) (20.93) (12.43) (5.23)
45 73 85 64 38 16 321
8
Chi-Square Independence Test
Example continued:
Because each expected frequency is at least 5 and the
drivers were randomly selected, the chi-square
independence test can be used to test whether the
variables are independent.
H0: The drivers’ ages are independent of gender.
Ha: The drivers’ ages are dependent on gender. (Claim)
9
Chi-Square Independence Test
11
F-Distribution
12
F-Distribution
F
1 2 3 4
13
Critical Values for the F-Distribution
14
Critical Values for the F-Distribution
Example:
Find the critical F-value for a right-tailed test when
= 0.05, d.f.N = 5 and d.f.D = 28.
Appendix B: Table 7: F-Distribution
d.f.D: Degrees = 0.05
of freedom, d.f.N: Degrees of freedom, numerator
denominator 1 2 3 4 5 6
1 161.4 199.5 215.7 224.6 230.2 234.0
2 18.51 19.00 19.16 19.25 19.30 19.33
Example:
Find the critical F-value for a two-tailed
= (0.10) = 0.05
test when = 0.10, d.f.N = 4 and d.f.D = 6.
Appendix B: Table 7: F-Distribution
d.f.D: Degrees = 0.05
of freedom, d.f.N: Degrees of freedom, numerator
denominator 1 2 3 4 5 6
1 161.4 199.5 215.7 224.6 230.2 234.0
2 18.51 19.00 19.16 19.25 19.30 19.33
3 10.13 9.55 9.28 9.12 9.01 8.94
4 7.71 6.94 6.59 6.39 6.26 6.16
5 6.61 5.79 5.41 5.19 5.05 4.95
6 5.99 5.14 4.76 4.53 4.39 4.28
7 5.59 4.74 4.35 4.12 3.97 3.87
18
Two-Sample F-Test
Example continued:
This is a two-tailed test with = ( 0.01) = 0.005, d.f.N = 15
and d.f.D = 12.
The critical value is F0 = 4.72.
1
0.005
2 The test statistic is
s12 885.06
F F 2 1.17.
1 2 3 4
F0 = 4.72 s2 756.25