Chi-Square Statistic

The chi-square statistic, χ² = Σ(Observed − Expected)²/Expected, measures the total distance between observed counts and the counts the null hypothesis predicts, relative to those expected counts. It's the test statistic for all three Unit 8 chi-square tests in AP Statistics.

Verified for the 2027 AP Statistics examLast updated June 2026

What is the Chi-Square Statistic?

The chi-square statistic answers one question with one number. How far off are your observed counts from the counts the null hypothesis says you should see? For each category, you take the gap (Observed − Expected), square it so negatives don't cancel positives, then divide by the expected count so the gap is judged relative to what was predicted. Add those up across every category and you get χ².

A gap of 10 means a lot when you expected 15, and almost nothing when you expected 1,500. Dividing by the expected count builds that proportional thinking right into the formula. If observed and expected counts match closely, χ² stays near zero. The further the data drifts from the null hypothesis, the bigger χ² grows, and it can only grow (squaring guarantees χ² is never negative). You then compare your statistic to a chi-square distribution with the right degrees of freedom, which is k − 1 categories for a goodness-of-fit test or (rows − 1)(columns − 1) for a two-way table, to find the p-value.

Why the Chi-Square Statistic matters in AP Statistics

This statistic is the engine of all of Unit 8 (Inference for Categorical Data: Chi-Square). The CED asks you to calculate it for a goodness-of-fit test (AP Stats 8.3.A) and for homogeneity or independence tests (AP Stats 8.6.A), then use it to find and interpret a p-value (8.3.B, 8.3.C, 8.6.B, 8.6.C) and justify a conclusion about the population (8.3.D, 8.6.D). Setting it up correctly also depends on Topic 8.2 skills, like computing expected counts as (sample size)(null proportion) and checking that all expected counts are greater than 5. Conceptually, chi-square extends the hypothesis-testing logic you learned with proportions in Units 6, but lets you handle a categorical variable with more than two categories or two categorical variables at once. That's something a z-test simply can't do.

How the Chi-Square Statistic connects across the course

Chi-square distribution (Unit 8)

The statistic is the number you compute from data; the distribution is the right-skewed family of curves it gets compared to. You find your p-value by asking what proportion of the chi-square distribution, with the correct degrees of freedom, is at or beyond your statistic.

Expected Count (Unit 8)

Expected counts are the 'E' in the formula, calculated as sample size times the null proportion for goodness-of-fit tests. Get the expected counts wrong and every term in χ² is wrong, which is why AP graders check this step first.

Degrees of Freedom (Unit 8)

The same χ² value means different things depending on degrees of freedom, since df picks which curve in the chi-square family you use. Goodness of fit uses categories minus 1; two-way tables use (rows − 1)(columns − 1).

Hypothesis Test logic (Units 6-8)

Chi-square tests follow the exact same four-part structure as the proportion and mean tests from earlier units. State hypotheses, check conditions, compute a statistic and p-value, then compare the p-value to α. Only the statistic and the type of data change.

Is the Chi-Square Statistic on the AP Statistics exam?

Multiple-choice questions love to hand you a table of observed counts and a set of null proportions, then ask which calculation correctly gives χ². A classic setup is a genetics problem with a 9:3:3:1 ratio and 320 offspring, where you must first convert the ratio to expected counts (180, 60, 60, 20) before plugging into Σ(O−E)²/E. Other stems give you a computed statistic, like χ² = 7.82 with 3 degrees of freedom, and ask when rejecting the null is appropriate, which tests whether you can connect the statistic to a p-value and a significance level. On the free-response section, chi-square problems typically demand the full inference procedure. That means naming the test, writing hypotheses about the distribution of proportions, verifying random sampling, the 10% condition, and all expected counts above 5, computing the statistic with correct df, and writing a conclusion in context. Showing at least one written-out term of the χ² sum is an easy way to earn calculation credit even if your arithmetic slips.

The Chi-Square Statistic vs Chi-square distribution

The chi-square statistic is a single number calculated from your sample, while the chi-square distribution is the theoretical curve that statistic follows when the null hypothesis is true. Think of the statistic as your score and the distribution as the grading scale. You need both to get a p-value, but on the exam, 'calculate the statistic' means do the Σ(O−E)²/E arithmetic, and 'use the distribution' means look up where that number falls for your degrees of freedom.

Key things to remember about the Chi-Square Statistic

  • The chi-square statistic is χ² = Σ(Observed count − Expected count)² / Expected count, summed over every category or cell.

  • Dividing each squared gap by the expected count means deviations are judged relative to what was predicted, so a small gap on a small expected count can matter more than a big gap on a huge one.

  • Chi-square values are always positive, and larger values mean the data is further from what the null hypothesis predicts, which leads to smaller p-values.

  • Degrees of freedom are (number of categories − 1) for a goodness-of-fit test and (rows − 1)(columns − 1) for a test of homogeneity or independence.

  • Before trusting the statistic, check conditions, including random sampling, n ≤ 10% of N when sampling without replacement, and all expected counts greater than 5.

  • The p-value is the probability, assuming the null hypothesis is true, of getting a chi-square statistic as large or larger than the one you observed.

Frequently asked questions about the Chi-Square Statistic

What is the chi-square statistic in AP Stats?

It's the test statistic for categorical data, calculated as χ² = Σ(Observed − Expected)²/Expected. It measures the total distance between the counts you observed and the counts the null hypothesis predicts, relative to those expected counts.

Can the chi-square statistic be negative?

No, never. Every term in the sum is a squared difference divided by a positive expected count, so χ² is always zero or positive. A value near zero means observed and expected counts match closely; a large value means big disagreement with the null hypothesis.

Is a big chi-square statistic automatically statistically significant?

Not by itself. Whether χ² is 'big' depends on the degrees of freedom, because that determines which chi-square curve you compare it to. For example, χ² = 7.82 with 3 degrees of freedom gives a p-value just under 0.05, so it's significant at α = 0.05 but not at α = 0.01.

What's the difference between the chi-square statistic and the p-value?

The statistic measures the raw distance between observed and expected counts; the p-value converts that distance into a probability. Specifically, the p-value is the chance of getting a statistic that large or larger if the null hypothesis is true, found from a chi-square distribution with the right degrees of freedom.

Do you calculate the chi-square statistic the same way for goodness of fit and independence tests?

Yes, the formula Σ(O−E)²/E is identical for both. What changes is how you find expected counts (null proportions times sample size for goodness of fit, versus row total times column total divided by table total for two-way tables) and the degrees of freedom, which are k − 1 versus (r − 1)(c − 1).