11.2.2 - Minitab: Goodness-of-Fit Test

11.2.2 - Minitab: Goodness-of-Fit Test

Example: Cards

Research Question: When randomly selecting a card from a deck with replacement, are we equally likely to select a heart, diamond, spade, and club?

I randomly selected a card from a standard deck 40 times with replacement. I pulled 13 Hearts (), 8 Diamonds (), 8 Spades (♠), and 11 Clubs (♣).

Minitab®  – Conducting a Chi-Square Goodness-of-Fit Test

Summarized Data, Equal Proportions

To perform a chi-square goodness-of-fit test in Minitab using summarized data we first need to enter the data into the worksheet. Below you can see that we have one column with the names of each group and one column with the observed counts for each group.

  C1 C2
  Suit Count
1 Hearts 13
2 Diamonds 8
3 Spades 8
4 Clubs 11
  1. After entering the data, select Stat > Tables > Chi-Square Goodness of Fit Test (One Variable)
  2. Double-click Count to enter it into the Observed Counts box
  3. Double-click Suit to enter it into the Category names (optional) box
  4. Click OK

This should result in the following output:

Chi-Square Goodness-of-Fit Test: Count

Observed and Expected Counts
Category Observed Test
Proportion
Expected Contribution
to Chi-Sq
Hearts 13 0.25 10 0.9
Diamonds 8 0.25 10 0.4
Spades 8 0.25 10 0.4
Clubs 11 0.25 10 0.1
Chi-Square Test
N DF Chi-Sq P-Value
40 3 1.8 0.615

All expected values are at least 5 so we can use the chi-square distribution to approximate the sampling distribution. Our results are \(\chi^2 (3) = 1.8\). \(p = 0.615\). Because our p-value is greater than the standard alpha level of 0.05, we fail to reject the null hypothesis. There is not enough evidence to conclude that the proportions are different in the population.

Note!

The example above tested equal population proportions. Minitab also has the ability to conduct a chi-square goodness-of-fit test when the hypothesized population proportions are not all equal. To do this, you can choose to test specified proportions or to use proportions based on historical counts.


11.2.2.1 - Example: Summarized Data, Equal Proportions

11.2.2.1 - Example: Summarized Data, Equal Proportions

Example: Tulips

A company selling tulip bulbs claims they have equal proportions of white, pink, and purple bulbs and that they fill customer orders by randomly selecting bulbs from the population of all of their bulbs.

You ordered 30 bulbs and received 16 white, 8 pink, and 6 purple.

Is there evidence the bulbs you received were not randomly selected from a population with an equal proportion of each color?

Use Minitab to conduct a hypothesis test to address this research question. 

We'll go through each of the steps in the hypotheses test:

Step 1: Check assumptions and write hypotheses

\(H_0\colon p_{white}=p_{pink}=p_{purple}=\dfrac{1}{3}\)
\(H_a\colon\) at least one \(p_i\) is not \(\dfrac{1}{3}\)

We can use the null hypothesis to check the assumption that all expected counts are at least 5.

\(Expected\;count=n (p_i)\)

All \(p_i\) are \(\frac{1}{3}\). \(30(\frac{1}{3})=10\), thus this assumption is met and we can approximate the sampling distribution using the chi-square distribution.

Step 2: Compute the test statistic

Let's use Minitab to calculate this.

First, enter the summarized data into a Minitab Worksheet.

  C1 C2
  Color Count
1 White 16
2 Pink 8
3 Purple 6
  1. After entering the data, select Stat > Tables > Chi-Square Goodness of Fit Test (One Variable)
  2. Double-click Count to enter it into the Observed Counts box
  3. Double-click Color to enter it into the Category names (optional) box
  4. Click OK

This should result in the following output:

Chi-Square Goodness-of-Fit Test: Count

Observed and Expected Counts
Category Observed Test
Proportion
Expected Contribution
to Chi-Sq
White 16 0.333333 10 3.6
Pink 8 0.333333 10 0.4
Purple 6 0.333333 10 1.6
Chi-Square Test
N DF Chi-Sq P-Value
30 2 5.6 0.061

The test statistic is a Chi-Square of 5.6.

Step 3: Determine the p-value
The p-value from the output is 0.061.
 
Step 4: Make a decision

\(p>0.05\) therefore we fail to reject the null hypothesis.

Step 5: State a "real world" conclusion

There is not evidence that your tulip bulbs were not randomly selected from a population with equal proportions of white, pink and purple.


11.2.2.2 - Example: Summarized Data, Different Proportions

11.2.2.2 - Example: Summarized Data, Different Proportions

Example: Roulette

An American roulette wheel contains 38 slots: 18 red, 18 black, and 2 green. A casino has purchased a new wheel and they want to know if there is any evidence that the wheel is unfair. They spin the wheel 100 times and it lands on red 44 times, black 49 times, and green 7 times.

Use Minitab to conduct a hypothesis test to address this question. 

We'll go through each of the steps in the hypotheses test:

Step 1: Check assumptions and write hypotheses

If the wheel is 'fair' then the probability of red and black are both 18/38 and the probability of green is 2/38.

\(H_0\colon p_{red}=\dfrac{18}{38}, p_{black}=\dfrac{18}{38}, p_{green}=\dfrac{2}{38}\)
\(H_a\colon\) at least one \(p_i\) is not as specified in the null

We can use the null hypothesis to check the assumption that all expected counts are at least 5.

\(Expected\;count=n (p_i)\)

With n = 100 we meet the assumptions needed to use Chi-square.

Step 2: Compute the test statistic

Let's use Minitab to calculate this.

First, enter the summarized data into a Minitab Worksheet.

  C1 C2
  Color Count
1 Red 44
2 Black 49
3 Green 7
  1. After entering the data, select Stat > Tables > Chi-Square Goodness of Fit Test (One Variable)
  2. Double-click Count to enter it into the Observed Counts box
  3. Double-click Color to enter it into the Category names (optional) box
  4. For Test select Input constants
  5. Select Proportions specified by historical counts (this is what we would expect if the null was true)
  6. Enter 18/38 for Black, 2/38 for Green and 18/38 for Red
  7. Click OK

This should result in the following output:

Chi-Square Goodness-of-Fit Test: Count

Observed and Expected Counts
Category Observed Historical Counts Test
Proportion
Expected Contribution
to Chi-Sq
Red 44 18 0.473684 47.3684 0.239532
Black 49 18 0.473684 47.3684 0.056199
Green 7 2 0.052632 5.2632 0.573158
Chi-Square Test
N DF Chi-Sq P-Value
100 2 0.868889 0.648

The test statistic is a Chi-Square of 0.87.

Step 3: Determine the p-value
The p-value from the output is 0.648.
 
Step 4: Make a decision

\(p>0.05\) therefore we fail to reject the null hypothesis.

Step 5: State a "real world" conclusion

There is not enough evidence to state that this roulette wheel is unfair.


Legend
[1]Link
Has Tooltip/Popover
 Toggleable Visibility