Section 13.2 – Chi-Squared Tests for Homogeneity We will be

advertisement
Section 13.2 – Chi-Squared Tests for Homogeneity
We will be comparing a given variable between two populations. Testing for “sameness” between distributions.
*Differences from GOF:
Expected count =
row total  column total
table total
d.f. = (rows – 1) (columns – 1)
Example: Distribution of Grades
A
49
52
101
Math
Phys. Sci.
Totals
B
69
73
142
C
64
78
142
D
42
23
65
Two populations: math and physical science
F
61
48
109
Totals
285
274
559
One Variable: grades
We’re going to test to see if the grade distributions between the two classes are the same.
 2 -test for homogeneity of populations
State: Hypotheses:
H0: Math and science have the same grade distribution
Ha: At least one of the grade categories is different.
Plan: Procedure:  2 -test for homogeneity
Calculating total Expected Values:
Math
Phys. Sci.
Totals
A
51.49
49.51
101
Expected count =
B
72.4
69.6
142
row total  column total
table total
C
72.4
69.6
142
Ex.
D
33.14
31.86
65
101  285
 51.49
559
d.f. = (rows – 1)(columns – 1) = (2 – 1)(5 – 1) = 1*4 = 4
Do: In calculator: Use matrices
2nd  MATRIX  EDIT
Enter both observed & expected counts in separate matrices.
When editing, ROW # X COLUMN #
STAT   2 -Test 
Observed: [A] (or whatever matrix you’ve put the information in)
Expected: [B]
Calculate:  2 = 8.47
p-value = 0.0757
d.f. = 4
F
55.57
53.43
109
Totals
285
274
559
Conclude: Since the p-value of 0.0757 is somewhat small, we have possible evidence to reject H0. There is
possible evidence that at least one of the grade categories is different.
Follow-up: Where is the biggest difference?
Compare % of observed amongst populations  Take number and divide by row total. Ex. 49/285 = 17%
Observed:
Math
A
17% (49)
B
24% (69)
C
22% (64)
D
15% (42)
F
21% (61)
Totals
100% (285)
Phys. Sci.
19% (52)
27% (73)
28% (78)
8% (23)
18% (48)
100% (274)
Totals
101
142
142
65
109
559
Expected: just look at column totals since we “expect” the distributions to be the same.
A
51.49
49.51
18.1%
(101)
Math
Phys. Sci.
Totals
B
72.4
69.6
25.4%
(142)
C
72.4
69.6
25.4%
(142)
Compare:
D
33.14
31.86
11.6%
(65)
F
55.57
53.43
19.5%
(109)
Totals
285
274
100%
(559)
expected value:
30
Percentage
25
20
Math
15
Phys. Sci.
10
5
0
A
B
C
D
F
Grade
We see major differences in the C & D range. The math class has more Ds than the Physical Science class, but
less Cs.
Download