AP Statistics

Download Report

Transcript AP Statistics

AP Statistics
• Section 14.2: Inference for Two-Way
Tables
• Objective: To be able to conduct a ChiSquare Test of Homogeneity and a ChiSquare Test of Independence.
• At this point we have no method for comparing multiple
proportions.
• When comparing 𝑝1 to 𝑝2 we use a two-proportion z-test.
• The best method for displaying categorical data in a twoway table is to use bar graphs.
𝜲𝟐 Test of Homogeneity (𝜲𝟐 -TOH)
This test is used to determine whether two or more
proportions from independent populations are equal. The
data comes from multiple SRSs or random assignment to
multiple treatment groups in an experiment.
1. Conditions:
• Data is an SRS from each population.
• All expected counts are greater than 1.
• No more than 20% of the expected counts are less than
5.
2. Hypotheses:
𝐻0 : 𝑝1 = 𝑝2 = . . . = 𝑝𝑛
𝐻𝑎 : at least one 𝑝𝑖 is different.
3. Rejection Region:
I will reject 𝐻0 if my p-value < 𝛼.
I will reject 𝐻0 if 2 > χ2 𝛼,𝑑𝑓
where df = (rows – 1)(columns – 1)
OR
4. Test Statistic & p-value:
2
(𝑜𝑏𝑠𝑒𝑟𝑣𝑒𝑑
𝑐𝑜𝑢𝑛𝑡
−
𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑
𝑐𝑜𝑢𝑛𝑡)
Χ2 =
𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑 𝑐𝑜𝑢𝑛𝑡
=
𝑂−𝐸
𝐸
2
𝑃(χ2 𝑑𝑓 > 2 )
5. State your conclusion in the context of the problem. (2
parts)
If we reject 𝐻0 , we can give a more detailed analysis by
analyzing the Χ 2 contributors (components).
Ex 1. In a recent study, a random sample of 200 third
grade boys and another random sample of 100 third grade
girls were taken and their viewing preferences were
recorded below.
Gender/Show Phineas & Ferb
Shake It Up
Wizards of
Waverly Place
Boys
104
65
31
Girls
32
25
43
Do the boys’ preferences for these TV programs differ
significantly from the girls’ preferences?
Ex 2. To determine if there was an association between
race and opinions about schools, researchers surveyed 3
randomly selected groups of parents and asked them “Are
high schools in your state doing an excellent, good, fair or
poor job, or don’t you know enough to say?”.
Rating/parent
Black Parents Hispanic Parents White Parents
Excellent
122
34
22
Good
69
55
81
Fair
75
61
60
Poor
24
24
24
𝛸 2 Test of Homogeneity and 2 x 2 Tables:
When using 2 x 2 tables to test a difference in proportions
from 2 independent populations, you can use the 𝛸 2 Test
of Homogeneity or the 2 proportion z-test.
Which is the better choice?
1.
2.
Bonus: The 𝛸 2 with k degrees of freedom is the
distribution of the sum of the squares of k independent
standard normal random variables.
𝑘
𝛸2 =
𝑍2𝑖
𝑖=1
Ex. 3 Suppose data is collected in 2 x 2 table and 𝐻𝑎 : 𝑝1 ≠
𝑝2 and 𝛼 = 0.05.
State the rejection region in terms of 𝛸 2 .
State the rejection region in terms of Z.
How are they related?
Ex. 4 Suppose that in a 2 proportion z-test on data
collected from a 2 x 2 table, the test statistic is Z = -1.53. If
a 𝛸 2 Test of Homogeneity was used instead, what would
be the test statistic in terms of 𝛸 2 and the p-value.
𝜲𝟐 Test of Independence:
This test is used when one sample is selected and the data are
classified by two categorical variables. (very similar to 𝛸 2 Test of
Homogeneity)
1. Conditions:
• Data is an SRS.
• All expected counts are greater than 1.
• No more than 20% of the expected counts are less than 5.
2. Hypotheses:
𝐻0 : The variables are independent
𝐻𝑎 : They are dependent
3. Rejection Region:
I will reject 𝐻0 if my p-value < 𝛼.
I will reject 𝐻0 if 2 > χ2 𝛼,𝑑𝑓
where df = (rows – 1)(columns – 1)
OR
4. Test Statistic & p-value:
2
(𝑜𝑏𝑠𝑒𝑟𝑣𝑒𝑑
𝑐𝑜𝑢𝑛𝑡
−
𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑
𝑐𝑜𝑢𝑛𝑡)
Χ2 =
𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑 𝑐𝑜𝑢𝑛𝑡
=
𝑂−𝐸
𝐸
2
𝑃(χ2 𝑑𝑓 > 2 )
5. State your conclusion in the context of the problem. (2
parts)
Ex. 5 A sample of customers from a Healthcare company
was selected and classified based on whether or not they
had complaints regarding their service and whether or not
that stayed or left the company. The data is recorded in
the table below.
No complaint
Medical Comp.
Non-medical Comp.
Stayed
743
199
440
Left
22
26
28
Is there a relationship between complaint status and
whether or not they leave the company?