Unit 33 Goodness of Fit

Suppose we wanted to know if where a student sits in the classroom is correlated with their final grade. Let’s say we divide the classroom up into six equal parts, a front section, a middle section and a rear section, and then the left side and the right side. If it does not matter where a student sits, we would expect the number of A’s in each section to be equal. Suppose there were 60 students in the class and that 30% of the students or 18 students received an A. If it didn’t matter where the A students sat, then the expected number of A’s in each section would be 3. Next, we count the actual or observednumber of A’s in each group and record the results in a table, as shown below.

Section / Expected / Observed
FR / 3 / 4
FL / 3 / 5
MR / 3 / 3
ML / 3 / 2
RR / 3 / 2
RL / 3 / 2

We are going to determine if there is a statistically significant difference between what we observed and what we would have expected if location had no bearing on the student’s final grade. To do this we use the following formula,

This is a chi-square statistic, and we will be using a right tail chi-square distribution for determining our pValue. You begin by entering your data into an Excel spreadsheet. If your expected values go into column A and your observed values go into column B, then the difference between A and B squared and divided by A would go into column C. For example, the first cell in column C would equal

The sum of all six results in column C is 2.6667. We then use the Chi-Square Right Tail tool to determine the pValue. The ChiSquare distribution requiresdegrees of freedom, where k is the number of categories. In the example above, k = 6

Always, all statistical tests are compared to a significance level. If this result would not be significant and we would conclude that whether or not a student receives an A is independent of where they sit.

Although the pValue is usually sufficient for most purposes, sometime the critical value is called for,

for

One of the problems with the analysis above is the small sample size. For a goodness-of-fit test, 60 data values might not be enough. Let’s multiply everything by 10. We would have,

Section / Expected / Observed
FR / 30 / 40
FL / 30 / 50
MR / 30 / 30
ML / 30 / 20
RR / 30 / 20
RL / 30 / 20

Now, the sum of the squared differences divided by the expected values is 26.6667, and the pValue is

which is significant. So even though the ratios are all the same, the larger sample size made a big difference.

Goodness-of-Fit can also be used to verify the claims of a manufacture. Suppose that Mars Candy was claiming that on average, a bag of M&Ms has 16% green ones, 20% orange, 14% yellow, 24% blue, 13% red, and 13% brown. Suppose you open enough bags of M&Ms so that you have 100 M&Ms and you count 13 red ones, 25 orange, 8 yellow, 8 brown, 27 blue, and 19 green. Below is the table showing the expected and observed numbers.

Color / Expected / Observed
Green / 16 / 19
Orange / 20 / 25
Yellow / 14 / 8
Blue / 24 / 27
Red / 13 / 13
Brown / 13 / 8

and

There is not a significant difference between what we observed and what Mars Candy is claiming.

This is the end of Unit 33. Turn now to MyMathLab to get more practice with these concepts.`

1