Transcript Chapter 10

Chapter 10
Chi-Square Tests and the FDistribution
Larson/Farber 4th ed
1
Chapter Outline
•
•
•
•
10.1 Goodness of Fit
10.2 Independence
10.3 Comparing Two Variances
10.4 Analysis of Variance
Larson/Farber 4th ed
2
Section 10.1
Goodness of Fit
Larson/Farber 4th ed
3
Section 10.1 Objectives
• Use the chi-square distribution to test whether a
frequency distribution fits a claimed distribution
Larson/Farber 4th ed
4
Multinomial Experiments
Multinomial experiment
• A probability experiment consisting of a fixed
number of trials in which there are more than two
possible outcomes for each independent trial.
• A binomial experiment had only two possible
outcomes.
• The probability for each outcome is fixed and each
outcome is classified into categories.
Larson/Farber 4th ed
5
Multinomial Experiments
Example:
• A radio station claims that the distribution of music
preferences for listeners in the broadcast region is as
shown below.
Distribution of music Preferences
Classical
4% Oldies
2%
Country
36% Pop
18%
Gospel
11% Rock
29%
Each outcome is
classified into
categories.
Larson/Farber 4th ed
The probability for
each possible
outcome is fixed.
6
Chi-Square Goodness-of-Fit Test
Chi-Square Goodness-of-Fit Test
• Used to test whether a frequency distribution fits an
expected distribution.
• The null hypothesis states that the frequency
distribution fits the specified distribution.
• The alternative hypothesis states that the frequency
distribution does not fit the specified distribution.
Larson/Farber 4th ed
7
Chi-Square Goodness-of-Fit Test
Example:
• To test the radio station’s claim, the executive can
perform a chi-square goodness-of-fit test using the
following hypotheses.
H0: The distribution of music preferences in the
broadcast region is 4% classical, 36% country,
11% gospel, 2% oldies, 18% pop, and 29% rock.
(claim)
Ha: The distribution of music preferences differs from
the claimed or expected distribution.
Larson/Farber 4th ed
8
Chi-Square Goodness-of-Fit Test
• To calculate the test statistic for the chi-square
goodness-of-fit test, the observed frequencies and the
expected frequencies are used.
• The observed frequency O of a category is the
frequency for the category observed in the sample
data.
Larson/Farber 4th ed
9
Chi-Square Goodness-of-Fit Test
• The expected frequency E of a category is the
calculated frequency for the category.
 Expected frequencies are obtained assuming the
specified (or hypothesized) distribution. The
expected frequency for the ith category is
Ei = npi
where n is the number of trials (the sample size)
and pi is the assumed probability of the ith
category.
Larson/Farber 4th ed
10
Example: Finding Observed and
Expected Frequencies
A marketing executive randomly
selects 500 radio music listeners
from the broadcast region and asks
each whether he or she prefers
classical, country, gospel, oldies,
pop, or rock music. The results are
shown at the right. Find the
observed frequencies and the
expected frequencies for each type
of music.
Larson/Farber 4th ed
Survey results
(n = 500)
Classical
8
Country
210
Gospel
72
Oldies
10
Pop
75
Rock
125
11
Solution: Finding Observed and
Expected Frequencies
Observed frequency: The number of radio music
listeners naming a particular type of music
Survey results
(n = 500)
Classical
8
Country
210
Gospel
72
Oldies
10
Pop
75
Rock
125
Larson/Farber 4th ed
observed frequency
12
Solution: Finding Observed and
Expected Frequencies
Expected Frequency: Ei = npi
Type of
music
Classical
Country
Gospel
Oldies
Pop
Rock
Larson/Farber 4th ed
% of
listeners
4%
36%
11%
2%
18%
29%
Observed
frequency
8
210
72
10
75
125
n = 500
Expected
frequency
500(0.04) = 20
500(0.36) = 180
500(0.11) = 55
500(0.02) = 10
500(0.18) = 90
500(0.29) = 145
13
Chi-Square Goodness-of-Fit Test
For the chi-square goodness-of-fit test to be used, the
following must be true.
1. The observed frequencies must be obtained by using
a random sample.
2. Each expected frequency must be greater than or
equal to 5.
Larson/Farber 4th ed
14
Chi-Square Goodness-of-Fit Test
• If these conditions are satisfied, then the sampling
distribution for the goodness-of-fit test is approximated
by a chi-square distribution with k – 1 degrees of
freedom, where k is the number of categories.
• The test statistic for the chi-square goodness-of-fit test is
2
(
O

E
)
2  
E
The test is always
a right-tailed test.
where O represents the observed frequency of each
category and E represents the expected frequency of each
category.
Larson/Farber 4th ed
15
Chi-Square Goodness-of-Fit Test
In Words
1. Identify the claim. State the
null and alternative
hypotheses.
In Symbols
State H0 and Ha.
2. Specify the level of
significance.
Identify .
3. Identify the degrees of
freedom.
d.f. = k – 1
4. Determine the critical
value.
Use Table 6 in
Appendix B.
Larson/Farber 4th ed
16
Chi-Square Goodness-of-Fit Test
In Words
In Symbols
5. Determine the rejection region.
6. Calculate the test statistic.
7. Make a decision to reject or fail
to reject the null hypothesis.
(O  E)2
 
E
2
If χ2 is in the
rejection region,
reject H0.
Otherwise, fail to
reject H0.
8. Interpret the decision in the
context of the original claim.
Larson/Farber 4th ed
17
Example: Performing a Goodness of Fit
Test
Use the music preference data to perform a chi-square
goodness-of-fit test to test whether the distributions are
different. Use α = 0.01.
Distribution of
music preferences
Classical
4%
Country
36%
Gospel
11%
Oldies
2%
Pop
18%
Rock
29%
Larson/Farber 4th ed
Survey results
(n = 500)
Classical
8
Country
210
Gospel
72
Oldies
10
Pop
75
Rock
125
18
Solution: Performing a Goodness of Fit
Test
• H0: music preference is 4% classical, 36% country,
11% gospel, 2% oldies, 18% pop, and 29% rock
• Ha: music preference differs from the claimed or
expected distribution
• Test Statistic:
• α = 0.01
• d.f. = 6 – 1 = 5
• Rejection Region
• Decision:
0.01
0
Larson/Farber 4th ed
15.086
• Conclusion:
χ2
19
Solution: Performing a Goodness of Fit
Test
Type of
music
Classical
Country
Gospel
Oldies
Pop
Rock
Observed
frequency
8
210
72
10
75
125
Expected
frequency
20
180
55
10
90
145
2
(
O

E
)
2  
E
(8  20)2 (210  180)2 (72  55) 2 (10  10) 2 (75  90) 2 (125  145) 2






20
180
55
10
90
145
 22.713
Larson/Farber 4th ed
20
Solution: Performing a Goodness of Fit
Test
• H0: music preference is 4% classical, 36% country,
11% gospel, 2% oldies, 18% pop, and 29% rock
• Ha: music preference differs from the claimed or
expected distribution
• Test Statistic:
• α = 0.01
χ2 = 22.713
• d.f. = 6 – 1 = 5
• Rejection Region
• Decision: Reject H0
0.01
0
Larson/Farber 4th ed
χ2
15.086
22.713
There is enough evidence to
conclude that the distribution
of music preferences differs
from the claimed distribution.
21
Example: Performing a Goodness of Fit
Test
The manufacturer of M&M’s candies claims that the
number of different-colored candies in bags of dark
chocolate M&M’s is uniformly distributed. To test this
claim, you randomly select a bag that contains 500 dark
chocolate M&M’s. The results are shown in the table on
the next slide. Using α = 0.10, perform a chi-square
goodness-of-fit test to test the claimed or expected
distribution. What can you conclude? (Adapted from
Mars Incorporated)
Larson/Farber 4th ed
22
Example: Performing a Goodness of Fit
Test
Color
Brown
Yellow
Red
Blue
Orange
Green
Frequency
80
95
88
83
76
78
n = 500
Larson/Farber 4th ed
Solution:
• The claim is that the
distribution is uniform, so
the expected frequencies of
the colors are equal.
• To find each expected
frequency, divide the sample
size by the number of colors.
• E = 500/6 ≈ 83.3
23
Solution: Performing a Goodness of Fit
Test
• H0: Distribution of different-colored candies in bags
of dark chocolate M&Ms is uniform
• Ha: Distribution of different-colored candies in bags
of dark chocolate M&Ms is not uniform
• Test Statistic:
• α = 0.10
• d.f. = 6 – 1 = 5
• Rejection Region
• Decision:
0.10
0
Larson/Farber 4th ed
9.236
• Conclusion:
χ2
24
Solution: Performing a Goodness of Fit
Test
2
(
O

E
)
2  
E
Color
Brown
Yellow
Red
Blue
Orange
Green
Observed
frequency
80
95
88
83
76
78
Expected
frequency
83.3
83.3
83.3
83.3
83.3
83.3
(80  83.3)2 (95  83.3)2 (88  83.3)2 (83  83.3)2 (76  83.3) 2 (78  83.3)2






83.3
83.3
83.3
83.3
83.3
83.3
 3.016
Larson/Farber 4th ed
25
Solution: Performing a Goodness of Fit
Test
• H0: Distribution of different-colored candies in bags
of dark chocolate M&Ms is uniform
• Ha: Distribution of different-colored candies in bags
of dark chocolate M&Ms is not uniform
• Test Statistic:
• α = 0.01
χ2 = 3.016
• d.f. = 6 – 1 = 5
• Rejection Region
• Decision: Fail to Reject H0
0.10
0
3.016
Larson/Farber 4th ed
9.236
χ2
There is not enough evidence
to dispute the claim that the
distribution is uniform.
26
Section 10.1 Summary
• Used the chi-square distribution to test whether a
frequency distribution fits a claimed distribution
Larson/Farber 4th ed
27