chapter 14: chi-square procedures
DESCRIPTION
Chapter 14: Chi-Square Procedures. 14.1 – Test for Goodness of Fit. ( 2 ). Chi-square test for goodness of fit:. Used to determine if what outcome you expect to happen actually does happen. Count of actual results. Observed Counts:. Expected Counts:. Count of expected results. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/1.jpg)
Chapter 14: Chi-Square Procedures
![Page 2: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/2.jpg)
14.1 – Test for Goodness of Fit
![Page 3: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/3.jpg)
Chi-square test for goodness of fit:
Used to determine if what outcome you expect to happen actually does happen
Observed Counts: Count of actual results
Expected Counts: Count of expected results
To find the expected counts multiply the proportion you expect times the sample size
(2)
![Page 4: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/4.jpg)
Note: Sometimes the probabilities will be expected to be the same and sometimes they will be expected to be different
![Page 5: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/5.jpg)
Chi-square test for goodness of fit:
A:all expected counts are ≥ 5
P:
H: Ho: All of the proportions are as expected
HA: One or more of the proportions are different from expected
N:GOF test
T: 22 O E
E
Don’t need!
df = k – 1 categories
![Page 6: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/6.jpg)
Properties of the Chi-distribution:
• Always positive (being squared)
• Skewed to the right
• Distribution changes as degrees of freedom change
![Page 7: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/7.jpg)
![Page 8: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/8.jpg)
• Area is shaded to the right
Properties of the Chi-distribution:
• Always positive (being squared)
• Skewed to the right
• Distribution changes as degrees of freedom change
![Page 9: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/9.jpg)
Calculator Tip! Goodness of Fit
L1: Observed
L2: Expected
L3: (L1 – L2)2 / L2
List – Math – Sum – L3
![Page 10: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/10.jpg)
Calculator Tip! P(2 > #)
2nd dist - 2cdf(2, big #, df)
![Page 11: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/11.jpg)
![Page 12: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/12.jpg)
![Page 13: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/13.jpg)
Example #1A study yields a chi-square statistic value of 20 (2 = 20). What is the P value of the test if the study was a goodness-of-fit test with 12 categories?
![Page 14: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/14.jpg)
![Page 15: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/15.jpg)
Example #1A study yields a chi-square statistic value of 20 (2 = 20). What is the P value of the test if the study was a goodness-of-fit test with 12 categories?
< P <0.025 0.05
Or by calc:
2cdf(20, 10000000, 11) =
2nd dist - 2cdf(2, big #, df)
0.04534
![Page 16: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/16.jpg)
Example #2A geneticist claims that four species of fruit flies should appear in the ratio 1:3:3:9. Suppose that a sample of 480 flies contains 25, 92, 68, and 295 flies of each species, respectively. Find the chi-square statistic and probability.
Observed
Expected
E
EO 2
25 92 68 295
480/1630
480/16 390
480/16 390
480/16 9270
225 30
30
0.833 0.044
292 90
90
5.378
268 90
90
2.315
2295 270
270
0.833 + 0.044 + 5.378 + 2.315 = 22 O E
E
8.57
![Page 17: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/17.jpg)
P(2 > 8.57) =
df = 4 – 1 = 3
![Page 18: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/18.jpg)
![Page 19: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/19.jpg)
P(2 > 8.57) =
df = 4 – 1 = 3
.025 < P(2 > 8.57) < 0.05
Or by calc:
2cdf(8.57, 10000000, 3) = 0.03559
![Page 20: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/20.jpg)
Example #3The number of defects from a manufacturing process by day of the week are as follows:
The manufacturer is concerned that the number of defects is greater on Monday and Friday. Test, at the 0.05 level of significance, the claim that the proportion of defects is the same each day of the week.
Monday Tuesday Wednesday Thursday Friday
# 36 23 26 25 40
H: The proportion of defects from a manufacturing process is the same Mon-Fri
Ho:
The proportion of defects from a manufacturing process is not the same Mon-Fri (on one day or more)
HA:
![Page 21: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/21.jpg)
A: Expected Counts
![Page 22: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/22.jpg)
Monday Tuesday Wednesday Thursday Friday
# 36 23 26 25 40
Expected
150 errors total.
150 5
= 30
30 30 30 30 30
A: Expected Counts
N: Chi-Square Goodness of Fit
![Page 23: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/23.jpg)
T:
2 =
Monday Tuesday Wednesday Thursday Friday
# 36 23 26 25 40
Expected 30 30 30 30 30
(O – E)2
E= 7.533
2 236 30 23 30
...30 30
![Page 24: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/24.jpg)
O: P(2 > 7.533) =
df = 5 – 1 = 4
![Page 25: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/25.jpg)
![Page 26: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/26.jpg)
P(2 > 7.533) =
df = 5 – 1 = 4
0.10 < P(2 > 7.533) > 0.15
Or by calc:
2cdf(7.533, 10000000, 4) = 0.1102
O:
![Page 27: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/27.jpg)
M:
P ___________
0.1102 0.05
>
Accept the Null
![Page 28: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/28.jpg)
S:
There is not enough evidence to claim the proportion of defects from a manufacturing process is not the same Mon-Fri (on one day or more)
![Page 29: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/29.jpg)
14.2 – Inference for Two-Way Tables
![Page 30: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/30.jpg)
To compare two proportions, we use a 2-Proportion Z Test. If we want to compare three or more proportions, we need a new procedure.
![Page 31: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/31.jpg)
Two – Way Table:
Organize the data for several proportions
R rows and C columns
Dimensions are r x c
![Page 32: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/32.jpg)
To calculate the expected counts, multiply the row total by the column total, and divide by the table total:
Expected count = Row total x Column total table total
Degrees of Freedom: (r – 1)(c – 1)
![Page 33: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/33.jpg)
Chi-Square test for Homogeneity:
Ho: The proportions are the same among all populations
Ha: The proportions are different among all populations
Expected Counts are ≥ 5
SRS
Conditions:
Compare two or more populations on one categorical variable
![Page 34: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/34.jpg)
Chi-Square test for Association/Independence:
Ho: There is no association between two categorical variables (independent)
Ha: There is an association (dependent)
Expected Counts are ≥ 5
SRS
Conditions:
Two categorical variables collected from a single population
![Page 35: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/35.jpg)
Calculator Tip! Test for Homogeneity/Independence
2nd – matrx – edit – [A] – rxc – Table info
Stat – tests – 2–test
Observed: [A]Expected: [B]Calculate
Then:
Note: Expected: [B] is done automatically!
![Page 36: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/36.jpg)
Example #1The table shows the number of people in each grade of high school who preferred a different color of socks.
a. What is the expected value for the number of 12th graders who prefer red socks?
Expected count = Row total x Column total table total
20 x 14 56
=
2014
1818
121515 56
= 5
![Page 37: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/37.jpg)
Example #1The table shows the number of people in each grade of high school who preferred a different color of socks.
b. Find the degrees of freedom.
(r – 1)(c – 1)
(3 – 1)(4 – 1)
(2)(3)
6
![Page 38: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/38.jpg)
Example #2An SRS of a group of teens enrolled in alternative schooling programs was asked if they smoked or not. The information is classified by gender in the table. Find the expected counts for each cell, and then find the chi-square statistic, degrees of freedom, and its corresponding probability.
Expected Counts: Row total x Column total table total
70 x 79 217
79 138
70
147217
147 x 79 217
70 x 138 217
147 x 138 217
=
=
=
=
25.484
53.516
44.516
93.484
![Page 39: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/39.jpg)
2 = (O – E)2
E=
Expected Counts:
Smoker Non-Smoker
Male
Female
25.484
53.516
44.516
93.484
0.56197
(23 – 25.484)2
25.48+ (47 – 44.516)2
44.516+ (56 – 53.516)2
53.516+ (91 – 93.484)2
93.484
![Page 40: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/40.jpg)
2 = (O – E)2
E=
Expected Counts:
Smoker Non-Smoker
Male
Female
25.484
53.516
44.516
93.484
0.56197
(r – 1)(c – 1) = (2 – 1)(2 – 1) = (1)(1) = 1Degrees of Freedom:
P(2 > 0.56197) =
![Page 41: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/41.jpg)
![Page 42: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/42.jpg)
2 = (O – E)2
E=
Expected Counts:
Smoker Non-Smoker
Male
Female
25.484
53.516
44.516
93.484
0.56197
(r – 1)(c – 1) = (2 – 1)(2 – 1) = (1)(1) = 1Degrees of Freedom:
P(2 > 0.56197) = More than 0.25 OR: 0.4535
![Page 43: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/43.jpg)
Example #3At a school a random sample of 20 male and 16 females were asked to classify which political party they identified with.
Democrat Republican Independent
Male 11 7 2
Female 7 8 1
Are the proportions of Democrats, Republicans, and Independents the same within both populations? Conduct a test of significance at the α = 0.05 level. H:
Ho: The proportions are the same among males and females and their political party
HA: The proportions are different among males and females and their political party
![Page 44: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/44.jpg)
A: SRS (says)
Expected Counts 5
Democrat Republican Independent
Male 11 7 2
Female 7 8 1
Row total x Column total table total
20 x 18 36
16 x 18 36
20 x 15 36
16 x 15 36
=
=
=
=
10
8
8.33
6.67
20 x 3 36
16 x 3 36
=
=
1.67
1.33
18 15 3
20
1636
Not all are expected counts are 5, proceed with caution!
![Page 45: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/45.jpg)
N: Chi-Square test for Homogeneity
![Page 46: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/46.jpg)
T:
2 = (O – E)2
E= 0.855
(11 – 10)2
10+ (7 – 8)2
8
Democrat Republican Independent
Male 11 7 2
Female 7 8 1
Male 10 8.33 1.67
Female 8 6.67 1.33
Expected
+ (7 – 8.33)2
8.33+ (8 – 6.67)2
6.67+ (2 – 1.67)2
1.67+ (1 – 1.33)2
1.33
![Page 47: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/47.jpg)
O:
(r – 1)(c – 1) = (2 – 1)(3 – 1) = (1)(2) = 2Degrees of Freedom:
P(2 > 0.855) =
![Page 48: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/48.jpg)
![Page 49: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/49.jpg)
More than 0.25
OR:
0.6521
O:
(r – 1)(c – 1) = (2 – 1)(3 – 1) = (1)(2) = 2Degrees of Freedom:
P(2 > 0.855) =
P(2 > 0.855) =
![Page 50: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/50.jpg)
M:
P ___________
0.6521 0.05
>
Accept the Null
![Page 51: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/51.jpg)
S:
There is not enough evidence to claim the proportions are different among males and females and their political party
![Page 52: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/52.jpg)
Example #4The following chart represents the score distribution on the AP Exams for different subjects at a certain high school. Is there evidence that the score distribution is dependent from the subject?
H:
Ho: AP scores and AP test are independent.
HA: AP scores and AP test are not independent.
![Page 53: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/53.jpg)
A: SRS (says)
Expected Counts 5
Row total x Column total table total
52 68 30
3442441812
150
![Page 54: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/54.jpg)
34 x 52 150
42 x 52 150
34 x 68 150
42 x 68150
=
=
=
=
11.787
14.56
15.413
19.04
34 x 30 150
42 x 30150
=
=
6.8
8.4
52 68 30
3442441812
150
44 x 52 150
44 x 68 150
= =15.253 19.947 44 x 30 150
= 8.8
![Page 55: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/55.jpg)
18 x 52 150
12 x 52 150
18 x 68 150
12 x 68150
=
=
=
=
6.24
4.16
8.16
5.44
18 x 30 150
12 x 30150
=
=
3.6
2.4
52 68 30
3442441812
150
Not all are expected counts are 5, proceed with caution!
![Page 56: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/56.jpg)
N: Chi-Square test for Independence
![Page 57: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/57.jpg)
T:
5 11.787 15.413 6.8
4 14.56 19.04 8.4
3 15.253 19.947 8.8
2 6.24 8.16 3.6
1 4.16 5.44 2.4
Expected
2 = (O – E)2
E= 5.227698
![Page 58: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/58.jpg)
O:
(r – 1)(c – 1) = (5 – 1)(3 – 1) = (4)(2) = 8Degrees of Freedom:
P(2 > 5.227698) =
![Page 59: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/59.jpg)
![Page 60: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/60.jpg)
More than 0.25
OR:
0.732985
O: P(2 > 5.227698) =
P(2 > 5.227698) =
(r – 1)(c – 1) = (5 – 1)(3 – 1) = (4)(2) = 8Degrees of Freedom:
![Page 61: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/61.jpg)
M:
P ___________
0.732985 0.05
>
Accept the Null
![Page 62: Chapter 14: Chi-Square Procedures](https://reader035.vdocuments.site/reader035/viewer/2022081511/568139d4550346895da18618/html5/thumbnails/62.jpg)
S:
There is not enough evidence to claim the AP scores and AP test are dependent