This course has been archived. The College Board updated AP Statistics for the 2026–27 school year, and the units and topics changed.
Go to the new AP® Statistics
6m left·0%
Reading Time: 6 min
Last Updated: March 25, 2026
Main Ideas: 4
Reading Time: 6 min
Last Updated: March 25, 2026
Main Ideas: 4

Topic 8.3 Notes – Carrying Out a Chi-Square Test for Goodness of Fit

Read aloud
You calculate the chi-square statistic, find the p-value using the chi-square distribution, interpret that p-value correctly, and then make a conclusion about a population distribution. This is where the mechanics and the meaning come together.

1. The Chi-Square Test Statistic for Goodness of Fit

A chi-square goodness of fit test compares:

  • Observed counts (O) from your sample
  • Expected counts (E) based on a claimed population distribution (your null model)

The test statistic is:

χ2=∑(O−E)2E \chi^2 = \sum \frac{(O - E)^2}{E}

Where:

  • OO = observed count in a category
  • EE = expected count in that category
  • You add up the value for all categories.

What each part is doing

Each term (O−E)2E\frac{(O - E)^2}{E}:

  • Measures how far one category’s data is from what was predicted.
  • Squaring makes all differences positive.
  • Dividing by EE adjusts for category size. A difference of 10 matters more if you expected 20 than if you expected 500.

Because everything is squared, χ² is always 0 or larger.

  • χ² near 0 → observed counts are close to expected → supports H0H_0
  • Large χ² → big differences → evidence against H0H_0

Degrees of freedom

df=number of categories−1 df = \text{number of categories} - 1

If you have 5 categories, then df=4df = 4.

What the null distribution looks like

If the null hypothesis (and its probability model) is true, the test statistic follows a chi-square distribution with the appropriate dfdf.

Here are several chi-square distributions for different degrees of freedom.

Study guide illustration

Chi-square distributions for different degrees of freedom

Key features:

  • Only defined for values ≥ 0
  • Right-skewed
  • Larger dfdf → more spread out and more symmetric

As dfdf increases, the curve shifts to the right and becomes less skewed, but it always stays nonnegative and right-skewed.

In some settings, a randomization distribution could be used instead of the theoretical chi-square curve, but on the AP exam you’ll almost always use the chi-square distribution.

2. Calculating the Chi-Square Statistic

Here’s what this looks like in action.

Imagine a company claims customer preferences are:

  • 50% Product A
  • 30% Product B
  • 20% Product C

You survey 200 customers and observe:

  • A: 88
  • B: 74
  • C: 38

Step-by-step

  1. Find expected counts

    E=n×p0 E = n \times p_0

    • A: 200×0.50=100200 \times 0.50 = 100
    • B: 200×0.30=60200 \times 0.30 = 60
    • C: 200×0.20=40200 \times 0.20 = 40
  2. Compute each component

    χ2=(88−100)2100+(74−60)260+(38−40)240 \chi^2 = \frac{(88-100)^2}{100} + \frac{(74-60)^2}{60} + \frac{(38-40)^2}{40}

    =144100+19660+440 = \frac{144}{100} + \frac{196}{60} + \frac{4}{40}

    =1.44+3.27+0.10=4.81 = 1.44 + 3.27 + 0.10 = 4.81

  3. Degrees of freedom

    df=3−1=2 df = 3 - 1 = 2

Using technology

On a calculator: use χ²GOF-Test, enter:

  • Observed list
  • Expected list

It gives you χ², dfdf, and the p-value.

Common mistakes I see every year:

  • Plugging in proportions instead of counts
  • Forgetting to square
  • Using the wrong dfdf

3. Finding and Interpreting the p-Value

Once you have χ² and dfdf, the p-value is:

The probability, assuming the null hypothesis and its probability model are true, of getting a chi-square statistic as large or larger than the one observed.

Because the chi-square distribution is right-skewed:

  • The p-value is the area to the right of your χ² value.

Large χ² → small p-value → stronger evidence against H0H_0.

You can:

  • Use calculator output (best option), or
  • Use a chi-square table with the correct dfdf.

Interpreting the p-value in context

Your interpretation must include:

  • “Assuming the null hypothesis is true”
  • The test statistic (or “a chi-square statistic”)
  • The numeric p-value
  • The real-world context

Example:

If the company’s claimed distribution is correct, the probability of getting a chi-square statistic of 4.81 or larger from a sample of 200 customers is 0.09.

Never say:

  • “There is a 9% chance the null is true.”
  • “There is a 9% chance the results happened by chance.”

4. Making a Decision and Stating the Conclusion

Compare the p-value to your significance level α \alpha .

  • If p ≤ α → Reject H0H_0
  • If p > α → Fail to reject H0H_0

Never say “accept H0H_0.”

Writing the conclusion

You need:

  1. Decision
  2. “Convincing evidence”
  3. Population + variable in context

If p = 0.09 and α = 0.05:

Since 0.09 > 0.05, we fail to reject the null hypothesis. There is not convincing evidence that the true distribution of customer preferences differs from the company’s claimed distribution.

Big picture meaning:

  • A significant result means at least one category proportion is different.
  • The test does not tell you which one.
  • A non-significant result means the data are consistent with the claimed distribution, not that it’s proven correct.

Key Takeaways

The chi-square statistic is χ2=∑(O−E)2E \chi^2 = \sum \frac{(O - E)^2}{E} , and it is always ≥ 0.
Degrees of freedom for goodness of fit are df=categories−1df = \text{categories} - 1.
The p-value is the right-tail area under the chi-square curve beyond your test statistic.
Interpret the p-value assuming H0H_0 is true and in full context.
A significant result means at least one population proportion differs, but the test does not identify which one.

AP® is a trademark registered by the College Board, which is not affiliated with, and does not endorse this website.

Notes

1 credit used · 5/5 remaining