Chapter 13 - Chi-square tests. After mastering the material in this chapter, you will be able to: Test hypotheses about multinomial probabilities by using a chi-square goodness-of-fit test, perform a goodness-of-fit test for normality, decide whether two qualitative variables are independent by using a chi-square test for independence.
ChiSquare Tests
13.1 ChiSquare GoodnessofFit Tests
13.2 A ChiSquare Test for Independence
132
LO13-1: Test
hypotheses about
multinomial probabilities
by using a chi-square
goodness-of-fit test.
13.1 ChiSquare GoodnessofFit
Tests
Collect count data to study how counts are
distributed among cells
Often use categorical data for statistical
inference
May use a multinomial experiment
◦Similar to a binomial experiment only more than
two outcomes are possible
133
LO13-1
The Multinomial Experiment
1. Carry out n identical trials with k possible
outcomes of each trial
2. Probabilities are denoted p1, p2, … , pk
where p1 + p2 + … + pk = 1
3. The trials are independent
4. The results are observed frequencies of the
number of trials that result in each of k
possible outcomes, denoted f1, f2, …, fk
134
LO13-1
ChiSquare Goodness of Fit Tests
Consider the outcome of a multinomial
experiment where each of n randomly
selected items is classified into one of k
groups
Let fi = number of items classified into group
i (ith observed frequency)
Ei = npi = expected number in ith group if pi
is probability of being in group i (ith expected
frequency)
135
LO13-1
A Goodness of Fit Test for Multinomial
Probabilities
H0: multinomial probabilities are p1, p2, … , pk
Ha: at least one of the probabilities differs from p1,
p2, … , pk 2
2
k
( fi Ei )
=
Test statistic: i 1 Ei
Reject H0 if
◦ 2 > or pvalue
LO13-2: Perform a
goodness of fit test for
normality.
Normal Distribution
Have seen many statistical methods based on
the assumption of a normal distribution
Can check the validity of this assumption
using frequency distributions, stemandleaf
displays, histograms, and normal plots
Another approach is to use a chisquare
goodness of fit test
137
LO13-2
A Goodness of Fit Test for a Normal
Distribution
1. Test the following null and alternative hypotheses:
H0: the population has a normal distribution
Ha: population does not have normal distribution
2. Select random sample and compute sample mean
and standard deviation
3. Define k intervals for the test
4. Record observed frequency (fi) for each interval
5. Calculate expected frequency (Ei)
2
6. Calculate the chisquare statistic 2
k
fi Ei
7. Make a decision i 1 Ei
138
LO13-3: Decide whether
two qualitative variables
are independent by
using a chi-square test
for independence.
13.2 A ChiSquare Test for Independence
Each of n randomly selected items is
classified on two dimensions into a
contingency table with r rows an c columns
and let
◦fij = observed cell frequency for ith row and jth
column
◦ri = ith row total
cj = jth column total
Expected cell frequency for ith row and jth
column under independence ri c j
Eˆ ij
n 139
LO13-3
A ChiSquare Test for Independence
Continued
H0: the two classifications are statistically
independent
Ha: the two classifications are statistically dependent
Test statistic 2
( f ij Eˆ ij ) 2
=
all cells Eˆ ij
Reject H0 if > 2 or if pvalue