Nonparametric Methods:: Goodness-of-Fit Tests
Nonparametric Methods:: Goodness-of-Fit Tests
Nonparametric Methods:: Goodness-of-Fit Tests
Goodness-of-Fit Tests
Chapter 17
McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
Learning Objectives
LO1 Conduct a test of hypothesis comparing an observed set
of frequencies to an expected distribution.
LO2 List and explain the characteristics of the chi-square
distribution.
LO3 Conduct a goodness-of-fit test for unequal expected
frequencies.
LO4 Conduct a test of hypothesis to verify that data grouped
into a frequency distribution is a sample from a normal
distribution.
LO5 Use graphical methods to determine if a set of sample
data is from a normal distribution.
LO6 Conduct a test of hypothesis to determine whether two
classification criteria are related.
17-2
LO1 List and explain the characteristics of
the chi-square distribution.
17-3
LO2 Conduct a test of hypothesis comparing an observed
set of frequencies to an expected distribution.
17-4
LO2
fo fe 2
2
fe
17-5
LO2
Goodness-of-Fit Example
The Bubba’s Fish and Pasta is a chain of restaurants located along the
Gulf Coast of Florida. Bubba, the owner, is considering adding steak to
his menu. Before doing so he decides to hire the Magnolia Research,
LLC to conduct a survey of adults as to their favorite meal when eating
out. Magnolia selected a sample of 120 adults and asked each to
indicate their favorite meal when dining out. The results are reported
below.
17-6
LO2
Goodness-of-Fit Example
Step 1: State the null hypothesis and the alternate hypothesis.
H0: there is no difference between fo and fe
H1: there is a difference between fo and fe
fo fe 2
2
fe
17-7
LO2
Goodness-of-Fit Example
Step 4: Formulate the decision rule.
Reject H0 if 2 2 ,k 1
fo fe 2
fe
,k 1
2
fo fe
2
fe
.05,41
2
fo fe 2
f 2.05,3
e
fo fe 2
f 7.815
e
17-8
LO2
Goodness-of-Fit Example
7.815
Critical
Value
17-9
LO2
Goodness-of-Fit Example
17-10
LO2
Goodness-of-Fit Example
7.815
Critical
Value
2.20
The computed χ2 of 2.20 is in the Fail to Reject H0 region, less the critical value of 7.815. The
decision, therefore, is to fail to reject H0 at the .05 level .
Conclusion: The difference between the observed and the expected frequencies is due to
chance. There appears to be no difference in the preference among the four entrees.
17-11
LO2
Chi-square - MegaStat
17-12
LO3 Conduct a goodness-of-fit test for
unequal expected frequencies.
17-13
LO3
Goodness-of-Fit Test: Unequal Expected
Frequencies - Example
17-14
LO3
Goodness-of-Fit Test: Unequal Expected
Frequencies - Example
Step 1: State the null hypothesis and the alternate hypothesis.
H0: There is no difference between local and national
experience for hospital admissions.
H1: There is a difference between local and national
experience for hospital admissions.
17-15
LO3
Goodness-of-Fit Test: Unequal Expected
Frequencies - Example
17-16
LO3
Goodness-of-Fit Test: Unequal Expected
Frequencies - Example
Expected frequencies of
Distribution stated in Frequencies observed in sample if the distribution
the problem a sample of 150 Bartow stated in the Null Hypothesis
residents is correct
Computation of fe
0.40 X 150 = 60
0.30 X 150 = 45
0.30 X 150 = 30
0.10 X 150= 15
17-17
LO3
Goodness-of-Fit Test: Unequal Expected
Frequencies - Example
Step 5: Compute the value of the chi-square
statistic and make a decision
fo fe 2
2
fe
Computed χ2
17-18
LO3
Goodness-of-Fit Test: Unequal Expected
Frequencies - Example
1.3723
The computed χ2 of 1.3723 is in the “Do not reject H0” region. The difference between the
observed and the expected frequencies is due to chance.
We conclude that there is no evidence of a difference between the local and national experience
for hospital admissions.
17-19
LO4 Conduct a test of hypothesis to verify that data grouped into
a frequency distribution is a sample from a normal distribution.
17-20
LO4
Convert each
class limit into a z-
score using mean
of $1,843.17 and
standard deviation
of $643.63, then
find the
probability.
17-21
LO4
Testing the Hypothesis That A Distribution of
Data Is From A Normal Population
0.0214 X 180 = 3.852
17-22
LO4
Testing the Hypothesis That A Distribution of
Data Is From A Normal Population
Step 3: Compute
the Ch-square
statistic using:
17-23
LO4
Testing the Hypothesis That A Distribution of
Data Is From A Normal Population
17-24
LO5 Use graphical methods to determine if a set
of sample data is from a normal distribution.
Graphical Approach to Confirm
Normality: Anderson-Darling Test
Step 1: Create 2 cumulative
distributions
a. Cumulative distribution of the
raw data
b. Cumulative normal
distribution
Step 2: Compare the 2
cumulative distributions
a. Search the largest absolute
numerical difference between
the 2 distributions
b. Using a statistical test, if the
difference is large, then we In the following graph the red dots represent the profit of each of
reject the null hypothesis that the the 180 vehicles from the Applewood Auto Group, and the blue
line, which is mostly covered by the red dots, represents a
data is normally distributed. normal cumulative distribution. The graph shows that the profit
data closely follows the blue line and that the distribution of
profits follows a normal distribution rather closely.
17-25
LO6 Conduct a test of hypothesis to determine
whether two classification criteria are related.
17-26
LO6
Contingency Analysis
We can use the chi-square statistic to formally test for a relationship between two
nominal-scaled variables. To put it another way, Is one variable independent of the
other?
Ford Motor Company operates an assembly plant in Dearborn, Michigan. The plant
operates three shifts per day, 5 days a week. The quality control manager wishes to
compare the quality level on the three shifts. Vehicles are classified by quality level
(acceptable, unacceptable) and shift (day, afternoon, night). Is there a difference in the
quality level on the three shifts? That is, is the quality of the product related to the shift
when it was manufactured? Or is the quality of the product independent of the shift on
which it was manufactured?
A sample of 100 drivers who were stopped for speeding violations was classified by
gender and whether or not they were wearing a seat belt. For this sample, is wearing a
seatbelt related to gender?
Does a male released from federal prison make a different adjustment to civilian life if
he returns to his hometown or if he goes elsewhere to live? The two variables are
adjustment to civilian life and place of residence. Note that both variables are
measured on the nominal scale.
17-27
LO6
17-28
LO6
Contingency Analysis - Example
The agency’s psychologists
interviewed 200 randomly
selected former prisoners.
Using a series of questions,
the psychologists classified
the adjustment of each
individual to civilian life as
outstanding, good, fair, or
unsatisfactory.
17-30
LO6
Contingency Analysis - Example
17-31
LO6
Computing Expected Frequencies (fe)
(120)(50)
200
17-32
LO6
Computing the Chi-square
Statistic
17-33
LO6
Conclusion
5.729
The computed χ2 of 5.729 is in the “Do not rejection H0” region. The null hypothesis is not
rejected at the .01 significance level.
We conclude there is no evidence of a relationship between adjustment to civilian life and where
the prisoner resides after being released from prison. For the Federal Correction Agency’s
advisement program, adjustment to civilian life is not related to where the ex-prisoner lives.
17-34
LO6
17-35