M&M Color Distribution Analysis
M&M Color Distribution Analysis
cc
P(x ≤ 6) = P(x ≤ 6.5)
6.5 – 9.95
= P z ≤
2.13
= P(z ≤ –1.62)
= 0.0526
P (7 ≤ x ≤ 8) = 0.1957
P (9 ≤ x ≤ 10) = 0.3543
P(11 ≤ x ≤ 12) = 0.2823
P (13 ≤ x ≤ 14) = 0.0989
P (x ≥ 15) = 0.0162
We can multiply these probabilities by the sample size (100) to determine the
expected frequencies. Here are the results, listed next to the observed frequencies.
6 or fewer 5 5.26
7 or 8 15 19.57
9 or 10 42 35.43
11 or 12 26 28.23
13 or 14 11 9.89
15 or more 1 1.62
Recall that each expected frequency has to be at least 5 to perform this test, and
the expected frequency for the last group (15 or higher) is only 1.62. We can com-
bine the last two classes to create a new class (13 or more) that has an expected
frequency of 11.51. Here are the new observed and expected frequencies.
6 or fewer 5 5.26
7 or 8 15 19.57
9 or 10 42 35.43
11 or 12 26 28.23
13 or more 12 11.51
Step 1
Claim in words: The data follow a normal distribution with a mean of 9.95 and
a standard deviation of 2.13.
(#1: 6 or fewer, #2: 7 or 8, #3: 9 or 10, #4: 11 or 12, #5: 13 or more)
Claim: π1 = 0.0526, π2 = 0.1957, π3 = 0.3543, π4 = 0.2823, π5 = 0.1151
Complement: At least one of the proportions is different than claimed.
H0: π1 = 0.0526, π2 = 0.1957, π3 = 0.3543, π4 = 0.2823, π5 = 0.1151
HA: At least one of the proportions is different than claimed.
Step 2
Level of significance: α = 0.05
486 CHAPTER 9 Other Hypothesis Tests
Step 3
(fo – fe)2
Test statistic: χ2 = ∑ , d.f. = (k – 1) – 2
fe
Step 4
There are (5 – 1) – 2 = 2 degrees of freedom. The critical value is 5.991.
Decision rule: Reject H0 if χ2 > 5.991.
Step 5
(fo – fe)2
fo fe = n • π fo – fe (fo – fe )2
fe
6 or fewer 5 5.26 –0.26 0.0676 0.0676/5.26
7 or 8 15 19.57 –4.57 20.8849 20.8849/19.57
9 or 10 42 35.43 6.57 43.1649 43.1649/35.43
11 or 12 26 28.23 –2.23 4.9729 4.9729/28.23
13 or more 12 11.51 0.49 0.2401 0.2401/11.51
χ2 = 2.495
p-value
The p-value is greater than 0.05. The use of technology would show us that the
actual p-value is 0.2872. This is strong evidence that the data do follow a normal
distribution. ■
Microsoft Excel does not provide a built-in procedure for goodness of fit, but we can
use its spreadsheet functions to calculate the test statistic. We will also learn how to
find the critical value for a goodness of fit test, as well as the p-value for its test statistic.
E XAMPLE A favorite example for the goodness of fit test involves the colors of
9.15 M&M candies, because samples are easy to obtain. Mars Inc.
claims that plain M&Ms are made in the following percentages.
Number 20 15 3 4 5 8
At the 0.05 level of significance, test the claim that Mars Inc.’s
claimed percentage breakdown of colors is correct.
9.3 The Goodness of Fit Test 487
In cell A2, type Brown, and then put the remaining colors Yellow, Red, Orange,
Green, and Blue in cells A3 through A7, respectively. In cell B1 type Observed,
and then put the appropriate observed frequencies from the sample (20, 15, 3, 4,
5, 8) in cells B2 through B7. In cell C1 type Expected, and then put the appropri-
ate expected frequencies in cells C2 through C7. Once all of these values have
been entered, we can begin our calculations.
=(B2-C2)*(B2-C2)/C2
This formula represents (fo – fe)2/fe for the first category, where B2 is the
observed frequency fo and C2 is the expected frequency for the first category.
Repeat the same in cells D3 through D7, being sure to change your formula to
match the row that you are in. For example, D3 should contain the following.
=(B3-C3)*(B3-C3)/C3
Once we have made our way through D7, we need to total these results to obtain
our test statistic. Typing the following in cell D8 will do the trick.
=SUM(D2:D7)
To find the critical value for a goodness of fit test, we use the following built-in Excel
function.
The level of significance is denoted by alpha. For the above example, type the fol-
lowing in any cell to find the critical value.
=CHIINV(0.05, 5)
To three decimal places, Excel tells us that the critical value is 11.070.
Excel can help us find the p-value at the end of the test. We will use the built-in
function that follows.
For our example, the test statistic was 9.606 and there were 5 degrees of freedom.
To find the p-value, type the following in any empty cell.
=CHIDIST(9.606,5)
The TI-83 does not provide a built-in procedure for goodness of fit, but we can use its lists
to calculate the test statistic. We will also learn how to find the p-value for its test statistic.
488 CHAPTER 9 Other Hypothesis Tests
E XAMPLE A favorite example for the goodness of fit test involves the colors of
9.16 M&M candies, because samples are easy to obtain. Mars Inc.
claims that plain M&Ms are made in the following percentages.
Number 20 15 3 4 5 8
At the 0.05 level of significance, test the claim that Mars Inc.’s
claimed percentage breakdown of colors is correct.
In list L1 we enter the six claimed proportions (0.3, 0.2, 0.2, 0.1, 0.1, 0.1). In list L2
we enter the observed frequencies (20, 15, 3, 4, 5, 8). In list L3 we will calculate the
expected frequencies. While L3 is active, use the ↑ key to enter a formula for L3.
We need to multiply the proportions in list L1 by 55. Enter this by typing 2nd 1
(to access L1) × 55 ENTER .
In list L4 we will calculate (fo – fe)2/fe for each category. While L4 is active, use the
↑ key to enter a formula for L4. We need to find the difference between lists L2
and L3, square these differences, and divide each by list L3. Enter this by typing
( 2nd 2 (to access list L2) – 2nd 3 (to access list L3) ) x2
÷ 2nd 3 (again, list L3) ENTER . The screen should look like this prior to
pressing ENTER , and again after pressing ENTER .
Finally, to calculate the test statistic, we need to total list L4. Press STAT to
access the STAT menu, press → to move to the CALC menu, and select option
1: 1-Var Stats. When you return to the main screen, press 2nd 4 (to access
list L 4) and ENTER . The test statistic will be found next to ∑x.
9.3 The Goodness of Fit Test 489
The TI-83 can help us find the p-value at the end of the test. We will use the built-in
function χ2cdf( that can be found in the DISTR menu. This function requires three
arguments. The first is the calculated value of the test statistic (lower bound), the
second is 1E99 (upper bound), and the third is the number of degrees of freedom.
Here are the steps to calculate the p-value for this example. Press 2nd VARS
to access the DISTR menu. Select option 7: χ2cdf(. When you return to the main
screen, press 9.606 , 1 2nd , (to access EE) 99 , 5 ) ENTER .
Recall that 9.606 is the test statistic and there are 5 degrees of freedom. Here are
the results.
EXERCISES 9.3
Use the standard procedure for all hypothesis tests.
1. A package of bell pepper seeds contained seeds for green, red, yellow, and orange
peppers. The seed company claims that 25% of the seeds that are put in these
packages are green, 25% are red, 25% are yellow, and 25% are orange. After plant-
ing, there were 31 green pepper plants, 26 red pepper plants, 21 yellow pepper
plants, and 22 orange pepper plants. At the 0.05 level of significance, test the com-
pany’s claim that each color makes up 25% of the seeds.
2. To a check a die for fairness, it is rolled 300 times. If the die is fair, then all of the
outcomes should be equally likely. Here are the results of the rolls.
Number on die 1 2 3 4 5 6
Number of rolls 57 43 44 53 46 57
At the 0.05 level of significance, test the claim that the die is fair; in other words,
the outcomes 1, 2, 3, 4, 5, and 6 are all equally likely.
3. In the game of roulette:
• the probability that the outcome is red is 0.474
• the probability that the outcome is black is 0.474
• the probability that the outcome is green is 0.052
In 150 spins of the roulette wheel, the outcome was red 76 times, black 62 times,
and green 12 times. At the 0.05 level of significance, test that the claimed proba-
bilities are true for this roulette wheel.
4. Three candidates are running for one open seat on the city council. A random
sample of 100 likely voters shows that 29 prefer candidate A, 40 prefer candidate
B, and 31 prefer candidate C. At the 0.05 level of significance, test the claim that
the three candidates are equally liked. Based on your results, can we state that the
voters prefer a candidate?
490 CHAPTER 9 Other Hypothesis Tests
5. A study reported that 28% of the primary vehicles owned by U.S. adults are less
than 3 years old, 34% are between 3 and 7 years old, and 38% are 8 years old or
older. (Source: Bruskin-Golding for Goodyear/Gemini Automotive Care.) A student
did not believe that cars in her area followed that breakdown, and she gathered
data on a random sample of 80 cars. Sixteen of the primary vehicles were less than
3 years old, 34 were between 3 and 7 years old, and the remaining 30 were 8 years
old or older. At the 0.05 level of significance, test the claim that the cars in the stu-
dent’s area follow the percentage breakdown reported by the study.
6. A study of K-12 teachers asked them how prepared they were to integrate technol-
ogy into instruction. Thirteen percent were very well prepared, 26% were well pre-
pared, 51% were somewhat prepared, and 10% were not prepared at all. (Source:
Market Data Retrieval.) A random sample of 60 small town K-12 teachers showed
the following results.
Very well 5
Well 11
Somewhat 33
Not at all 11
At the 0.05 level of significance, test the claim that teachers in this small town fol-
low the distribution reported by the study.
7. A pair of dice are rolled 200 times. Here are the probabilities for possible sums, if
the dice are fair.
2 1/36 8 5/36
3 2/36 9 4/36
4 3/36 10 3/36
5 4/36 11 2/36
6 5/36 12 1/36
7 6/36
Sum 2 3 4 5 6 7 8 9 10 11 12
Number of Rolls 4 16 17 16 27 43 25 18 15 16 3
At the 0.01 level of significance, test the claim that the sums produced by this pair
of dice follow the given probability distribution.
8. A computer program claims to generate random numbers. Here are 100 numbers
between 1 and 10 that were supposed to be randomly generated.
1 1 2 1 9 4 8 6 5 3
8 6 3 7 7 3 9 6 4 6
5 1 1 9 2 10 4 6 6 2
8 7 5 10 8 8 8 7 2 4
2 3 2 5 7 4 9 10 2 9
7 8 6 9 8 4 8 7 9 9
6 9 5 3 3 3 8 1 3 7
3 6 6 6 2 7 9 5 9 5
5 8 3 10 3 8 9 3 6 6
3 4 9 2 7 8 4 8 1 8
9.3 The Goodness of Fit Test 491
At the 0.05 level of significance, test the claim that these numbers are randomly
generated. (If the numbers were randomly generated, then any of the numbers
between 1 and 10 should be equally likely to be chosen.)
9. Forty-five percent of Americans have type O blood, 40% have type A, 11% have
type B, and 4% have type AB. A biology class tests the blood of 250 students. Of
these students, 124 have type O, 108 have type A, 14 have type B, and 4 have type
AB. At the 0.05 level of significance, test the claim that the claimed blood type per-
centages are correct.
10. The maker of a nondairy “ice cream” holds a taste test. Subjects taste the nondairy
“ice cream,” as well as three popular brands of ice cream. Of 120 ice cream eaters,
21 selected the nondairy “ice cream” as their favorite, while 42 selected ice cream
A, 28 selected ice cream B, and 29 selected ice cream C. At the 0.01 level of signifi-
cance, test the claim that ice cream eaters equally prefer the four different products.
11. Are all seven days of the week at restaurants equally busy? Here are the number
of customers that ate at a certain restaurant last month, broken down by the days
of the week.
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
1139 901 954 1017 989 1443 1536
At the 0.01 level of significance, test the claim that the proportion of the week’s
restaurant business is equal for each day of the week. (Based on the results of a
survey by the National Restaurant Association.)
12. During a 4-week period, a particular hospital had 172 births. Here is the break-
down of deliveries by day of the week.
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
18 25 28 27 27 27 20
At the 0.05 level of significance, test the claim that the proportion of births is equal
for each day of the week. (Source: Centers for Disease Control and Prevention,
Monthly Vital Statistics Report.)
13. During the last calendar year, a particular hospital had 2209 births. Here is the
breakdown by season.
Winter Spring Summer Fall
(Dec., Jan., Feb.) (Mar.–May) (June–Aug.) (Sep.–Nov.)
540 536 562 571
At the 0.05 level of significance, test the claim that the proportion of all babies
born is equal for each season. (Source: Centers for Disease Control and Prevention,
Monthly Vital Statistics Report.)
14. An algebra instructor tells his students on the first day of class that 40% will pass,
30% will fail, and 30% will withdraw that semester if historical patterns hold true.
The class began with 38 students. Seventeen of the students passed the class, 6
failed, and the rest dropped. At the 0.05 level of significance, test the claim that
the instructor made on the first day of class.
15. In 1990, 24.5% of Americans 25 years old and over had not graduated from high
school, 48.9% held a high school diploma, and 26.6% held at least an associate’s
degree. (Source: U.S. Department of Commerce, Bureau of the Census. Note:
Percentages altered to total to 100%.) A recent study of 440 Americans 25 years old
and over showed that 89 had not graduated from high school, 208 were high
school graduates, and 143 held at least an associate’s degree. At the 0.05 level, test
the claim that the 1990 proportions no longer hold true.
16. A 1970 study showed that of American married-couple families, 42.9% had no
children, 18.3% had one child, 18.0% had two children, and 20.8% had three or
more children. (Source: U.S. Department of Commerce, Bureau of the Census.) A
recent survey of 500 American married-couple, families revealed that 267 had no
children, 87 had one child, 96 had two children, and 50 had three or more chil-
dren. At the 0.01 level of significance, test the claim that the 1970 proportions are
no longer valid.
17. In 1987, teachers were asked to rate the availability and responsiveness of parents
when the teachers needed to contact them. Here is the percentage breakdown for
the responses to that question.
492 CHAPTER 9 Other Hypothesis Tests
Recently, a random sample of 529 teachers were asked to rate the availability and
responsiveness of parents when they needed to contact them. Here are the responses.
Excellent Good Fair Poor
85 249 143 52
At the 0.05 level of significance, test the claim that the proportions from 1987 are
valid today.
18. A random sample of 80 moviegoers was asked which of the following movie gen-
res was their favorite: action/adventure, comedy, horror, and romance. Here are
the results.
Season Number
Jan.–Mar. 51
Apr.–June 86
July–Sept. 99
Oct.–Dec. 64
At the 0.05 level of significance, test the claim that the proportion of marriages is
the same for all four seasons. (Based on a study by Bride’s magazine.)
At the 0.05 level of significance, test the claim that the following sets of data follow a nor-
mal distribution.
20. SAT math scores of 60 students
280 610 660 530 550 480 640 500 640
580 370 640 520 540 390 510 410 470
320 560 530 230 500 490 390 600 680
540 510 530 550 750 440 660 570 710
600 510 590 570 500 790 500 320 580
480 650 610 700 430 520 750 690 480
510 750 510 530 400 720
Use the following classes: 390 and below, 400 to 490, 500 to 590, 600 to 690, 700
and above.
21. Number of pull-ups performed by 40 fourth graders
0 8 9 6 6 4 9 5 9 7
1 9 5 6 1 5 2 4 0 7
6 0 5 4 1 8 9 6 5 6
6 10 3 9 7 10 8 5 8 7
Use the following classes: 2 or fewer, 3 to 4, 5 to 6, 7 to 8, 9 and above.
9.3 The Goodness of Fit Test 493
22. Number of rejects produced per day on an assembly line, for a 56-day period
4 3 2 0 0 1 1 3
2 4 2 4 3 2 2 2
1 3 2 0 3 3 1 1
1 0 1 0 0 1 1 0
3 0 1 0 1 3 1 1
2 0 0 1 1 0 2 2
1 1 0 0 3 1 3 2
23. Number of tornadoes that struck Utah for each year from 1950 through 1995
Year Number Year Number Year Number Year Number Year Number
Use the following classes: less than 1 (i.e., 0), 1, 2, 3, 4 or more. (Data from Utah
Disaster Center Web site.)
A B C D F
5% 15% 35% 25% 20%
A student believes that this is merely a motivating ploy to encourage students to study hard-
er. Fifty students took the first exam, producing the following results.
A B C D F
9 11 19 6 5
The student uses these results to test the instructor’s claim about the grade breakdown on
test 1, using the hypothesis test introduced in this section.
What is wrong with this picture?
494 CHAPTER 9 Other Hypothesis Tests
M I N I P RO J E C T
brown eyes, what percentage of people have blue eyes, and what percentage
of people have another color eyes. Randomly sample a minimum of 100 stu-
dents at your school and record their eye color. Use this information to test the
eye color percentage breakdown at the 0.05 level of significance. In addition to
your hypothesis test, include
SECTION 9.4
Contingency Tables and the Hypothesis Test for Independence
In this section we will learn a hypothesis test to determine whether two categorical
variables are related or not. If the two variables are not related, then the variables are
said to be independent. In our first example, we will test to see whether a person’s
burger preference is independent of the person’s gender. If we find that the two vari-
ables are not independent, we say that they are dependent. This does not necessarily
suggest that one of the variables affects the other, just that there is a relationship
between the two.
For this test we will make use of a contingency table. The frequencies in the con-
tingency table correspond to the two variables. One variable categorizes the rows and
the other categorizes the columns. Here is an example of a contingency table.
Male 15 18 35 15
Female 35 12 10 10
The row variable is the gender of the person, and the column variable is the burger
preference of the person.
As was the case in the last section, we will use fo to denote an observed frequency.
The observed frequencies are the values that are found in the cells of the contingency
table. We will use fe to denote an expected frequency. This will be the number that we
expect in each cell if the two variables are indeed independent. If the observed and
expected frequencies are similar, this is evidence that the two variables are independ-
ent. If the observed and expected frequencies are not similar, this is evidence that the
two variables are not independent. As with the goodness of fit test, it is necessary that
each of the expected frequencies is at least 5.
Recall from Chapter 3 that two events A and B are independent if P(A B)
= P(A) • P(B). We will use this formula to help us find the expected frequencies for a
contingency table. Consider this contingency table.
9.4 Contingency Tables and the Hypothesis Test for Independence 495
Male 15 18 35 15
Female 35 12 10 10
Male 15 18 35 15 83
Female 35 12 10 10 67
Total 50 30 45 25 150
The probability that a person selected from this sample is male is 83/150. The proba-
bility that a person selected from this sample prefers Burger King is 50/150. If these
two variables are independent, then the probability that a person selected from this
sample is male and prefers Burger King can be found by multiplying the previous two
probabilities, (83/150) • (50/150). As in the last section, if we know the probability
that an individual observation ends up in a particular cell, then we can multiply that
probability by the sample size to find the expected frequency of that cell. In this case,
we expect that 150 • (83/150) • (50/150) or 27.7 males prefer Burger King. This cal-
culation could be simplified to be (83 • 50)/150 by canceling the sample size of 150
with one of the denominators. Note that 83 is the total of the row and 50 is the total
of the column that the cell is in, while 150 is the sample size. This translates into the
following formula for the expected frequency of any cell.
How many males should we have expected to prefer McDonald’s? The total of the
row is 83, and the total of the column is 30.
83 • 30
fe =
150
= 16.6
The expected number of males that prefer McDonald’s is 16.6. How many males
should we have expected to prefer In-N-Out?
83 • 45
fe =
150
= 24.9
The expected frequency for that cell is 24.9. We could multiply to find the last expected
frequency in the top row, but there is another property that we could take advantage
of. The total of expected frequencies for any one row or column is equal to the total
of observed frequencies for that row or column. Since there are 83 individuals in the
top row and we have already accounted for 69.2 individuals (27.7 + 16.6 + 24.9) in
the first three cells, the expected frequency for the last cell is 83 – 69.2 = 13.8.
We could use the same addition property to find the expected frequencies for the
second row. The expected frequencies for the first column (Burger King) are supposed
496 CHAPTER 9 Other Hypothesis Tests
to add up to equal 50. Since we have 27.7 in the top row, there must be 50 – 27.7 = 22.3
in the second row. After all of the expected frequencies have been calculated, we will
write them in their respective cells inside parentheses as follows.
Male 15 18 35 15 83
(27.7) (16.6) (24.9) (13.8)
Female 35 12 10 10 67
(22.3) (13.4) (20.1) (11.2)
Total 50 30 45 25 150
The null hypothesis in the test for independence is always that the two variables
are independent, and the alternate hypothesis is always that the two variables are
dependent. The test statistic for the test for independence is exactly the same as the
test statistic for the test for goodness of fit, except that the number of degrees of free-
dom is different.
(fo – fe )2
χ2 = ∑ , degrees of freedom = (r – 1)(c – 1)
fe
When calculating the number of degrees of freedom, r is the number of rows in the
table and c is the number of columns in the table.
E XAMPLE One hundred fifty students at the College of the Sequoias were
9.17 asked their preference of burgers. Their responses were catego-
rized as Burger King, McDonald’s, In-N-Out, and Other. Here are
the results.
Male 15 18 35 15
Female 35 12 10 10
At the 0.05 level of significance, test the claim that burger prefer-
ence and gender are independent.
Step 1
Claim: Burger preference and gender are independent.
Complement: Burger preference and gender are dependent.
H0: Burger preference and gender are independent.
HA: Burger preference and gender are dependent.
Step 2
Level of significance: α = 0.05
Step 3
(fo – fe )2
Test statistic: χ2 = ∑ , d.f. = (r – 1)(c – 1)
fe
Step 4
There are (2 – 1)(4 – 1) = 3 degrees of freedom. The critical value is 7.815.
Decision rule: Reject H0 if χ2 > 7.815.
9.4 Contingency Tables and the Hypothesis Test for Independence 497
Step 5
We begin by calculating the expected frequencies, which was already done earlier
in the section. Here are the expected frequencies in parentheses, along with their
observed frequencies.
Male 15 18 35 15 83
(27.7) (16.6) (24.9) (13.8)
Female 35 12 10 10 67
(22.3) (13.4) (20.1) (11.2)
Total 50 30 45 25 150
When putting the observed and expected frequencies for each cell in columns to
calculate the test statistic, be sure to keep them next to each other. Here is the
calculation of the test statistic, which is exactly the same as in the last section.
(fo – fe )2
fo fe fo – fe (fo – fe )2
fe
15 27.7 –12.7 161.29 161.29/22.7
18 16.6 1.4 1.96 1.96/16.6
35 24.9 10.1 102.01 102.01/24.9
15 13.8 1.2 1.44 1.44/13.8
35 22.3 12.7 161.29 161.29/22.3
12 13.4 –1.4 1.96 1.96/13.4
10 20.1 –10.1 102.01 102.01/20.1
10 11.2 –1.2 1.44 1.44/11.2
χ2 = 24.007
p-value
We know that the p-value must be less than 0.05 because we rejected the null
hypothesis. Using the chi-square distribution chart, we can tell that the p-value is
also less than 0.01. The use of technology would show us that the actual p-value
is 0.000025. ■
We see a lot that is familiar for this hypothesis test; the major difference is how
the expected frequencies are found. We will take a look at another example before
moving on to a variation of this hypothesis test.
E XAMPLE A random sample of 200 students (K–12) were asked to list their
9.18 favorite sport out of the following four choices: football, basketball,
baseball, and soccer. Here are the results, broken down by the
grade level of the student.
Elementary 16 11 23 38
Junior High 14 17 6 8
High School 21 18 15 13
498 CHAPTER 9 Other Hypothesis Tests
At the 0.01 level of significance, test the claim that sport preference
and type of school are independent.
Step 1
Claim: Sport preference and type of school are independent.
Complement: Sport preference and type of school are dependent.
H0: Sport preference and type of school are independent.
HA: Sport preference and type of school are dependent.
Step 2
Level of significance: α = 0.01
Step 3
(fo – fe )2
Test statistic: χ2 = ∑ , d.f. = (r – 1)(c – 1)
fe
Step 4
There are (3 – 1)(4 – 1) = 6 degrees of freedom. The critical value is 16.812.
Decision rule: Reject H0 if χ2 > 16.812.
Step 5
To calculate the expected frequencies, we begin by totaling the rows and columns.
Elementary 16 11 23 38 88
Junior High 14 17 6 8 45
High School 21 18 15 13 67
Total 51 46 44 59 200
Here are the calculations and expected frequencies in parentheses, along with their
observed frequencies.
Elementary 16 11 23 38 88
88 • 51 88 • 46 88 • 44 88 • 59
= 22.4 = 20.2 = 19.4 = 26.0
200 200 200 200
Junior High 14 17 6 8 45
45 • 51 45 • 46 45 • 44 45 • 59
= 11.5 = 10.4 = 9.9 = 13.3
200 200 200 200
High School 21 18 15 13 67
67 • 51 67 • 46 67 • 44 67 • 59
= 17.1 = 15.4 = 14.7 = 19.8
200 200 200 200
Total 51 46 44 59 200
(fo – fe )2
fo fe fo – fe (fo – fe )2
fe
16 22.4 –6.4 40.96 40.96 / 22.4
11 20.2 –9.2 84.64 84.64 / 20.2
23 19.4 3.6 12.96 12.96 / 19.4
38 26.0 12.0 144.0 144.0 / 26.0
14 11.5 2.5 6.25 6.25 / 11.5
17 10.4 6.6 43.56 43.56 / 10.4
6 9.9 –3.9 15.21 15.21 / 9.9
8 13.3 –5.3 28.09 28.09 / 13.3
21 17.1 3.9 15.21 15.21 / 17.1
18 15.4 2.6 6.76 6.76 / 15.4
15 14.7 0.3 0.09 0.09 / 14.7
13 19.8 –6.8 46.24 46.24 / 19.8
χ2 = 24.275
p-value
We know that the p-value must be less than 0.01 because we rejected the
null hypothesis. The use of technology would show us that the actual p-value
is 0.000465. ■
This procedure that we have been using to test for independence is also used to
test for homogeneity. In such a test, we are testing to determine whether two or more
populations follow the same distribution. The major difference between these two tests
is how the sample is gathered. In the test for independence, we sample from one pop-
ulation, and then divide up that population into categories for the two variables. In
the test for homogeneity, we divide one of the variables into categories before we sam-
ple. Then we gather samples from these individual populations. In this type of sam-
pling we are able to control the total number of values for each category of that one
variable. In the previous example, if we decided ahead of time to sample 120 students
from elementary school, 40 students from junior high school, and 80 students from
high school instead of sampling from the combined population of these three schools,
then this would be a test of homogeneity.
As far as we are concerned, there is no other difference between these two tests.
Our results will still end up in a contingency table, and the way that we calculate the
expected frequencies for each cell, as well as the test statistic and number of degrees
of freedom, is exactly the same. Here is an example.
Males 73 44 21 57
Females 83 38 14 39
At the 0.05 level of significance, test the claim that both males and
females follow the same distribution of time required to graduate.
Step 1
Claim: Males and females follow the same distribution of time required to graduate.
Complement: At least one of the proportions is different for males and females.
H0: Males and females follow the same distribution of time required to graduate.
HA: At least one of the proportions is different for males and females.
Step 2
Level of significance: α = 0.05
Step 3
(fo – fe )2
Test statistic: χ2 = ∑ , d.f. = (r – 1)(c – 1)
fe
Step 4
There are (2 – 1)(4 – 1) = 3 degrees of freedom. The critical value is 7.815.
Decision rule: Reject H0 if χ2 > 7.815.
Step 5
Here is the table with the rows and columns totaled, and expected values already
calculated.
Males 73 44 21 57 195
(82.4) (43.3) (18.5) (50.7)
Females 83 38 14 39 174
(73.6) (38.7) (16.5) (45.3)
(fo – fe )2
fo fe = n • π fo – fe (fo – fe )2
fe
73 82.4 –9.4 88.36 88.36 / 82.4
44 43.3 0.7 0.49 0.49 / 43.3
21 18.5 2.5 6.25 6.25 / 18.5
57 50.7 6.3 39.69 39.69 / 50.7
83 73.6 9.4 88.36 88.36 / 73.6
38 38.7 –0.7 0.49 0.49 / 38.7
14 16.5 –2.5 6.25 6.25 / 16.5
39 45.3 –6.3 39.69 39.69 / 45.3
χ2 = 4.672
9.4 Contingency Tables and the Hypothesis Test for Independence 501
p-value
We know that the p-value must be greater than 0.05 because we failed to reject
the null hypothesis. The use of technology would show us that the actual p-value is
0.1975. ■
Microsoft Excel can assist us with calculating the test statistic for the chi-square test
for independence. We will also use Excel to find the critical value and p-value for this
test. Here is the example we will use.
E XAMPLE One hundred fifty students at the College of the Sequoias were
9.20 asked their preference of burgers. Their responses were catego-
rized as Burger King, McDonald’s, In-N-Out, and Other. Here are
the results.
Male 15 18 35 15
Female 35 12 10 10
At the 0.05 level of significance, test the claim that burger prefer-
ence and gender are independent.
In a new Excel worksheet, type Observed in cell A1. In cells A2 through D3, type
the observed values from the contingency table. Here is what your worksheet
should look like so far.
Observed
15 18 35 15
35 12 10 10
The next step is to calculate the expected frequencies. In cell A4, type Expected.
In cell A5, we will calculate the expected frequency for the first cell in the top row
(males that prefer Burger King). Type the following in cell A5.
=SUM($A2:$D2)*SUM(A$2:A$3)/SUM($A$2:$D$3)
This will always be the format for the expected frequency of the first cell in the top
row. In the above formula, A2 represents the observed frequency at the top left of
the table, A3 is the bottom left, D2 is the top right, and D3 is the bottom right. If
you work with a table that is of a different size than the table in this example, be
sure to adjust this formula accordingly. Also, be sure to put the dollar signs ($) in
the same location. To finish calculating the expected frequencies, copy cell A5 and
paste it into cells A5 through D6. Here is what your worksheet should look like at
this point.
Observed
15 18 35 15
35 12 10 10
Expected
27.6667 16.6 24.9 13.8333
22.3333 13.4 20.1 11.1667
502 CHAPTER 9 Other Hypothesis Tests
The next step is to calculate the test statistic. We will begin by calculating
(fo – fe )2/fe for each cell. In cell A7, type Calculations. Type the following in
cell A8:
=(A2-A5)^2/A5
This calculates (fo – fe )2/fe for the first cell in the top row. Copy cell A8 and paste
the contents into cells A8 through D9. Your worksheet should now look like this.
Observed
15 18 35 15
35 12 10 10
Expected
27.6667 16.6 24.9 13.8333
22.3333 13.4 20.1 11.1667
Calculations
5.7992 0.1181 4.0968 0.0984
7.1841 0.1463 5.0751 0.1219
Finally, we must total these values to find the test statistic. Type Test Statistic in cell
A10, and type =SUM(A8:D9) in cell A11. This test statistic calculates to be 22.640
when rounded to three decimal places. (Earlier in the section, we calculated the
test statistic to be 22.725. The error is due to the fact that we rounded all expected
frequencies to one decimal place, whereas Excel did not round them at all.)
To find the critical value for a test for independence, we use the following built-in
Excel function.
The level of significance is denoted by alpha. For the above example, there are
3 degrees of freedom. Type the following in any cell to find the critical value.
=CHIINV(0.05, 3)
To three decimal places, Excel tells us that the critical value is 7.815.
Excel can help us find the p-value at the end of the test. We will use the built-in
function that follows.
For our example, the test statistic was 22.640 and there were 3 degrees of free-
dom. To find the p-value, type the following in any empty cell.
=CHIDIST(22.640,3)
The critical value that Excel gives us is 0.000048, which is less than 0.0001. ■
E XAMPLE One hundred fifty students at the College of the Sequoias were
9.20 asked their preference of burgers. Their responses were catego-
rized as Burger King, McDonald’s, In-N-Out, and Other. Here are
the results.
9.4 Contingency Tables and the Hypothesis Test for Independence 503
Male 15 18 35 15
Female 35 12 10 10
At the 0.05 level of significance, test the claim that burger prefer-
ence and gender are independent.
Press STAT → → to access the STAT TESTS menu, and select option
C: χ2 - Test. Following Observed, we should see [A] (matrix A). This matrix con-
tains our observed frequencies. Next to Expected, we should see [B]. Matrix B is
the matrix that will hold our expected frequencies, should we want to take a look at
them. Press Calculate to complete the test. The output window contains the cal-
culated test statistic and the p-value, as well as the number of degrees of freedom.
Here is the output for our example.
EXERCISES 9.4
Use the standard procedure for all hypothesis tests.
1. A random sample of 400 Americans were asked whether they had health insur-
ance. Here are the results, broken down by race.
504 CHAPTER 9 Other Hypothesis Tests
Insurance 16 52 40 207
No Insurance 5 16 22 42
At the 0.01 level of significance, test the claim that race is independent of health
insurance status. (Based on results from the Current Population Survey by the
Census Bureau.)
2. A random sample of 747 people who were about to take a flight were asked to rate
how safe from terrorists they felt. Here are the results, broken down by gender.
At the 0.05 level of significance, test the claim that gender is independent of the
safety rating. (Based on the results of a CNN/USA Today/Gallup poll.)
3. A random sample of 1000 was asked whether they voted in the last general elec-
tion. Here are the results, broken down by age group.
At the 0.01 level of significance, test the claim that voting status and age are inde-
pendent. (Based on the results of a poll for the American Association of Health
Plans.)
4. In January 2000, 500 college students were asked to classify a Democratic Presi-
dential candidate as liberal or moderate. Here are their responses, broken down by
the political affiliation of the respondent.
Liberal Moderate
Democrats 44 111
Independents 95 99
Republicans 95 56
At the 0.05 level of significance, test the claim that the political affiliation of the
respondent and the response are independent.
5. A biology class performed 2500 blood tests on randomly selected students. Here are
the blood types and Rh factors of these 2500 students.
O A B AB
At the 0.05 level of significance, test the claim that blood type and Rh factor are
independent.
6. An exit poll of 500 voters in the 1998 Minnesota gubernatorial election shows the
number of voters who voted for Humphrey (D), Coleman (R), or Ventura (I) by age
group.
18–29 15 33 37
30–44 35 54 76
45–59 50 49 46
60 or older 43 40 22
9.4 Contingency Tables and the Hypothesis Test for Independence 505
At the 0.05 level of significance, test the claim that choice of candidate and age
are independent. (Based on the results of a CNN exit poll.)
7. A new osteoporosis medication is being tested to see if it can lower the chance of
a woman suffering a spinal fracture. A sample of 2250 women were randomly
assigned to one of three groups: standard dosage, reduced dosage, placebo. The
women were monitored for a period of three years. Here are the results, showing
the number of women who did/did not suffer a spinal fracture, broken down by
the medication groups.
Fracture 37 51 81
No Fracture 713 699 669
At the 0.05 level of significance, test the claim that the proportion of women who
suffer a spinal fracture is the same for all three medication treatments. (Based on
the results of a study led by Dr. Bruce Ettinger of the Kaiser Permanente Medical
Care Program, published in the Journal of the American Medical Association.)
8. A random sample of 200 Americans were asked how concerned they were about
the Y2K bug in December 1998, one year before potential problems. A second ran-
dom sample of 300 Americans were polled in September 1999, three months prior
to the potential problems. Here are the results.
Dec. ’98 31 83 60 26
Sept. ’99 19 94 133 54
At the 0.05 level of significance, test the claim that the feelings of Americans
remained the same from December ’98 to September ’99. (The proportional distribu-
tion for December ’98 is the same as the proportional distribution for September ’99.)
(Based on the results of a poll by USA Today and the National Science Foundation.)
9. A researcher divided up American drivers into five age groups (18–25, 26–35,
36–45, 46–55, and 56 and older), and took random samples of 60 drivers from
each group. Each driver was asked whether they run red lights. Here are the results.
18–25 46 14
26–35 43 17
36–45 38 22
46–55 34 26
56 and older 20 40
At the 0.01 level of significance, test the claim that the proportion of drivers who
run red lights is the same for all five age groups. (Based on a study by the Social
Science Research Center, Department of Psychology, Old Dominion University.)
10. A random sample of 440 students were asked whether they had a computer at
home. Here are the results, by family income.
Computer No Computer
At the 0.01 level of significance, test the claim that the proportion of students with
a computer at home is the same for each income level.
506 CHAPTER 9 Other Hypothesis Tests
11. A blood bank researcher contacted 125 Americans ages 25–34 and another 350
Americans that were at least 35 years old, and inquired about the last time the
person donated blood. Here are the results.
At the 0.05 level of significance, test the claim that the proportional distribution is
the same for both age groups.
12. A random sample of 601 parents of elementary school children were asked about
their own education level and whether they volunteered at their child’s school.
Here are the results.
At the 0.01 level of significance, test the claim that educational attainment and
volunteering at school are independent. (Based on the results of the National
Household Education Survey by the U.S. Department of Education, National
Center for Education Statistics.)
13. Here are the results of a random sample of 535 adults.
At the 0.01 level of significance, test the claim that educational attainment and
smoking status are independent.
14. A random sample of 483 workers were asked how they saved things: in piles, in
files, or some combination of both. Here are the results, broken down by gender.
Male 78 138 69
Female 30 110 58
At the 0.05 level, test the claim that the technique used is independent of gender.
(Based on the results of a study by Taylor Nelson Sofres Intersearch.)
15. A sample of 300 men and women were asked “How long should couples date
before getting married?” Here are the results.
Men 31 45 48 16 10
Women 29 43 51 16 11
9.4 Contingency Tables and the Hypothesis Test for Independence 507
At the 0.05 level of significance, test the claim that a person’s response to this ques-
tion is independent of the person’s gender. (Based on “The Virginia Slims Opinion
Poll 2000” by Roper Starch Worldwide.)
16. A random sample of 1977 high school students were asked whether they felt too
unsafe to go to school at least once in the preceding 30 days. Here are the results,
broken down by race.
Yes 33 45 42
No 819 707 331
At the 0.05 level of significance, test the claim that whether or not a high school
student has felt too unsafe to go to school is independent of his or her race. (Based
on the Morbidity and Mortality Weekly Report, June 9, 2000, by the Centers for
Disease Control and Prevention.)
17. A random sample of 2278 high school females were asked whether they had seri-
ously considered attempting suicide in the 12 months prior to the survey. Here are
the results, broken down by grade.
At the 0.05 level of significance, test the claim that whether or not a female high
school student has seriously considered suicide is independent of her grade. (Based
on the Morbidity and Mortality Weekly Report by the Centers for Disease Control
and Prevention.)
18. A random sample of 600 people were asked whether they go to the movies at least
once a month. Here are the results, broken down by age.
Age
18–24 25–34 35–44 45–54 55–64 65 and up
Yes 83 54 43 37 27 20
No 17 46 57 63 73 80
At the 0.05 level of significance, test the claim that whether a person attends the
movies regularly is dependent on a person’s age. (Based on the results of a study
by TELENATION/Market Facts.)
19. A sample of 605 parents of high school students were asked “Are the public high
schools in your state doing an excellent, good, fair, or poor job?” (Sixty-five parents
said they did not know enough to say.) Here are the results, broken down by race.
Excellent 22 12 34
Good 80 69 55
Fair 60 75 61
Poor 24 24 24
At the 0.05 level of significance, test the claim that a person’s response is inde-
pendent of his or her race. (Source: “Great Expectations: How the Public and
Parents—White, African American and Hispanic—View Higher Education,” by
Public Agenda.)
20. A sample of 605 parents of high school students were asked “When it comes to your
own child, do you think a college education is something absolutely necessary
to get, something helpful but not necessary, or not that important?” (Sixty-five