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: 6
Reading Time: 6 min
Last Updated: March 25, 2026
Main Ideas: 6

Topic 8.2 Notes – Setting Up a Chi-Square Goodness of Fit Test

Read aloud
You use this test when you have one categorical variable and want to check whether the population distribution of proportions matches a specific claim. This includes identifying the right test, writing correct hypotheses, calculating expected counts, and checking conditions.

What a Chi-Square Goodness-of-Fit Test Is

A chi-square goodness-of-fit (GOF) test compares your observed counts from a sample to the expected counts you would get if a claimed distribution were true.

You use it when:

  • There is one categorical variable
  • There are two or more categories
  • You’re testing a claimed distribution of proportions

Example situations:

  • A cereal company claims flavors are distributed 20%, 30%, 25%, 25%.
  • A die is claimed to be fair (each face 1/6).
  • A school claims grade levels are evenly distributed.

If there are only two categories and you're testing a single proportion, that’s a 1-proportion z test, not chi-square.
If you're comparing two categorical variables, that’s a chi-square test of independence, which is a different setup.

Parameters

The parameters are the true population proportions:

p1,p2,…,pk p_1, p_2, \dots, p_k

These must add to 1. Each pip_i represents the true proportion in a specific category.

Expected Counts and the Chi-Square Statistic

The whole test is built around comparing what you saw to what you would expect under H0H_0.

Expected Counts

For each category:

Expected=n×(null proportion) \text{Expected} = n \times (\text{null proportion})

If a sample of 200 customers is tested against a claim that 40% prefer vanilla, the expected number preferring vanilla is:

200(0.40)=80 200(0.40) = 80

Expected counts are based entirely on:

  • Sample size nn
  • Claimed proportions from H0H_0

They are not based on what you actually observed.

The Chi-Square Statistic

The test statistic measures how far observed counts are from expected counts:

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

  • Big differences between observed and expected → large χ2 \chi^2
  • Small differences → small χ2 \chi^2
  • Always 0 or positive (because of squaring)

Large χ2 \chi^2 values fall in the right tail of the distribution and give small p-values.

Chi-Square Distributions

The chi-square statistic follows a chi-square distribution, which has some unique features:

  • Continuous
  • Only positive values
  • Skewed right
  • Shape depends on degrees of freedom

For a GOF test:

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

Here’s how the distribution changes as degrees of freedom increase:

Chi-square distributions for df = 1, 4, and 10

With df=1df = 1, the distribution is very right-skewed and concentrated near 0. As dfdf increases to 4 and then 10, the curve becomes less skewed and more spread out, though it is always right-skewed and stays above 0.

Hypotheses for a GOF Test

Null Hypothesis H0H_0

Lists the claimed proportion for each category.

Example (favorite season survey):

H0:pFall=0.25,  pWinter=0.25,  pSpring=0.25,  pSummer=0.25 H_0: p_{\text{Fall}} = 0.25,\; p_{\text{Winter}} = 0.25,\; p_{\text{Spring}} = 0.25,\; p_{\text{Summer}} = 0.25

Each pp must be clearly defined in context. On a free-response question, you would say what each proportion represents.

Alternative Hypothesis HaH_a

At least one of the population proportions differs from the stated value.

Important:

  • Do not say “all are different.”
  • Do not compare categories to each other.
  • You are testing the overall distribution, not pairwise differences.

Conditions for Inference

All three must be satisfied.

1. Random

Data come from:

  • A random sample, or
  • A randomized experiment

Quote the wording if possible.

2. Independence

If sampling without replacement:

nN≤0.10 \frac{n}{N} \le 0.10

The population must be at least 10 times the sample size.

3. Large Counts

All expected counts must be:

≥5 \ge 5

You check this using expected counts, not observed counts. This ensures the chi-square distribution is a good model.

Identifying the Correct Test

When you read a problem, ask:

  • Is there one categorical variable?
  • Are we testing whether the distribution matches a claim?

If yes → chi-square GOF.

Students often misidentify the test when there are only two categories. If it says “Is the proportion different from 0.60?” and there are only two outcomes, that’s a 1-proportion z test.

Key Takeaways

A GOF test compares observed counts to expected counts calculated as n×null proportionn \times \text{null proportion}.
Degrees of freedom for GOF is df=k−1df = k - 1, where kk is the number of categories.
The alternative hypothesis is that at least one population proportion differs from the null values.
The chi-square distribution is right-skewed and only takes positive values.
Always check that all expected counts are at least 5, not the observed counts.

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