Title: 13'1: Test for Goodness of Fit
113.1 Test for Goodness of Fit
2chi-square (X2) Test for Goodness of Fit
- You could conduct a z test for every MM color,
but this would not be efficient. - More important, these tests would not tell us how
much our sample differs from the MM/Mars
Companys six sample proportion. - Instead we use the chi-square (X2) test for
goodness of fit - a single test to determine if the observed sample
distribution is significantly different from the
hypothesized population distribution.
3Ex 1 Accidents and Cell Phones
- A study of 699 drivers who were using a cell
phone when involved in a collision examined the
following Are you more likely to have a
collision when using a cell phone? These
drivers made 26,798 cell phone calls during a
14-month period. Here are the collision counts
for each day of the week
This is a one-way table with seven cells.
4Ex 1 Accidents and Cell Phones
- Are the accidents equally likely to occur on any
day of the week? - Ho Accidents involving cell phone use are
equally likely to occur on each of the seven days
of the week. - Ha The probabilities of an accident involving
cell phone use vary from day to day. - or, state in terms of proportions
- Ho psunday pmonday psaturday 1/7
- Ha At least one of the proportions differs from
the stated value.
5Ex 2 Accidents and Cell Phones
- We will perform a significance test (X2 test for
goodness of fit). First, plot the data.
6Ex 2 Accidents and Cell Phones
- Next, calculate the expected counts (sample size
x proportion of distribution) for each day - 699 accidents x (1/7) 99.86.
- Now, graph.
7Ex 2 Accidents and Cell Phones
- To determine whether the distribution is uniform,
we measure (each day) with the following - The sum of the calculations is the chi-square
(X2) statistic.
8Ex 2 Accidents and Cell Phones
As X2 gets larger, we have more evidence against
the null hypothesis.
9Ex 2 Accidents and Cell Phones
- Go to Table D (Chi-Square Distribution)
- Degrees of Freedom Cells 1 7 1 6
- At P-value of 0.0005, the critical value is
24.10. - Our X2 208.84, which is more extreme.
- The probability of observing a result as extreme
as the one we actually observed, by chance alone,
is less than 0.05. There is sufficient evidence
to reject Ho and conclude that these accidents
are not equally likely to occur on each of the
seven days of the week.
10Test for Goodness of Fit
11Chi-Square Distributions
As the DF increase, curves become less skewed and
larger values become more likely.
12Properties
- Chi-Square Curve Properties
- Total area under curve is 1.
- Each curve (except DF 1) begins at 0 on the
horizontal axis, increases to a peak, and then
approaches the axis asymptotically. - Every curve is skewed to the right. As the DF
increase, the curve approaches normality.
13Ex 3 Red-Eyed Fruit Flies
- Biologists wish to mate two fruit flies having
genetic makeup RrCc, indicating that each has one
dominant gene (R) and one recessive gene (r) for
eye color, along with one dominant (C) and one
recessive (c) gene for wing type. Each offspring
will receive one gene for each of the two traits
from each parent. The following table
illustrates the possibilities
14Ex 3 Red-Eyed Fruit Flies
9 red-eyed, straight winged (x) 3 white-eyed,
straight winged (z) 3 red-eyed, curly-winged
(y) 1 white-eyed, curly-winged (w)
15Ex 3 Red-Eyed Fruit Flies
- To test their hypothesis, biologists mate the
flies. Of 200 offspring - 99 had red eyes and straight wings
- 42 had red eyes and curly wings
- 49 had white eyes and straight wings
- 10 had white eyes and curly wings
- Do these data significantly differ from the
biologists predictions?
16Ex 3 Red-Eyed Fruit Flies
- Step 1 Hypotheses
- Step 2 Conditions We can use the chi-square
goodness of fit if cell counts are large enough
(greater than 5). - RS (200)(0.5625) 112.5
- RC (200)(0.1875) 37.5
- WS (200)(0.1875) 37.5
- WC (200)(0.0625) 12.5
17Ex 3 Red-Eyed Fruit Flies
- Step 3 Calculations
-
-
- For df 4 1 3, Table D shows that our test
statistic falls between the critical values for a
0.15 and 0.10 significance level. (Technology
produces an actual P-value of .1029). -
18Technology Toolbox
- Enter observed counts into L1. Calculate
expected counts into L2. - Define L3 as (L1 L2)2/L2.
- Calculate L3 sum by going LIST/MATH and sum(L3)
- Find X2cdf under DISTR
- X2cdf (2nd Ans, Very Large Number, DF)
- X2cdf (Ans, 1E99,3)
- Add 1 (may depend on calculator model???)
19Ex 3 Red-Eyed Fruit Flies
- Step 4 Interpretation
- The P-value of 0.1029 indicates that the
probability of obtaining a sample of 200 fruit
fly offspring in which the proportions differ
from the hypothesized values by at least as much
as the ones in our sample is over 10. We fail
to reject Ho, or the biologists predicted
distribution. -