Mistake Master
Student view — seeing the site as a student does
Mistake Master · AP Statistics · Unit 3 · Step-Through Animation

Carrying Out a Chi-Square Test for Homogeneity or Independence

The Test Says Something Differs. It Never Says What, or Which Way

You'll learnhow to carry out a chi-square test — adding one squared, scaled discrepancy per cell, reading the p-value from the upper tail with degrees of freedom that come from the table's shape, writing the conclusion in context, and the three conclusions a significant chi-square does not license.

The statistic adds up how far each cell landed from what the null predicted, squared so that overshoots and undershoots both count, and divided by the expected count so that a gap of 20 means more where 30 were expected than where 300 were. For the three-school table that total is 12.15 on 2 degrees of freedom, and the p-value is the area to its right — always the right, because only a large statistic disagrees with the null. At 0.0023 it clears any usual standard, and then the sentence has to be written carefully, because a chi-square result invites three conclusions it cannot support: which cell is responsible, what caused it, and, when the p-value is large, that the variables are independent. It cannot even say which direction the difference runs, and this page proves that rather than asserting it: swap the two response columns so school A runs low instead of high, and the statistic comes back identical to the last decimal. Twelve short steps; press Next for each one.

12 STEPS · 6 QUICK CHECKS · THE STATISTIC AND ITS COMPONENTS · THE UPPER TAIL · WHAT IT CANNOT SAY · v2

Squaring keeps the size of a departure and destroys its direction.
Before you start
What you're looking at
Topic 3.14's table, now measured. Each bar is one cell: how far it landed from the count the null predicted for it.
The question
Is the whole table further from the null's picture than sampling explains — and once the answer is yes, what may actually be said?
Step 1 / 12

Read all 12 steps as text
Step 1

Every cell missed what the null predicted

Topic 3.14 left six observed counts and six expected ones; each bar here is simply the distance between them, before anything is done to it.

Step 2

Squaring stops the two gaps cancelling

School A sits 19.6 above its expected yes count and 19.6 below its expected no count, so adding the gaps as they stand gives that school a score of zero — squaring each one first is what stops the cancellation.

Step 3

Divide by expected so the cells compare

Each squared gap is divided by the count the null expected in that cell, so school A's yes cell contributes \(\frac{(120-100.4)^2}{100.4} \approx 3.84\) — and the six terms become addable.

Step 4

Add the six, and read df off the shape

The six contributions add to \(\chi^2 \approx 12.15\), and the degrees of freedom come from the table's shape — \((3-1)(2-1) = 2\) — never from the 550 students.

Step 5

The curve a true null would produce

If the null were true, the totals repeated samples produce would follow this chi-square curve with 2 degrees of freedom: highest near zero and falling away to the right.

Step 6

The p-value is the upper tail, always

Marking 12.15 on that curve and shading everything beyond it gives \(p = e^{-6.076} \approx 0.0023\) — the right-hand area, because only a large total disagrees with the null.

Step 7

The same number against a bigger table

Put the identical 12.15 against a chi-square curve with 10 degrees of freedom and the tail beyond it holds about 0.275: more cells free to wander means a larger total is ordinary.

Step 8

Reject, and name the populations

Back at 2 degrees of freedom, 0.0023 is below \(\alpha = 0.05\): reject \(H_0\), with convincing evidence that the distribution of responses is not the same for students at all three schools.

Step 9

It cannot tell you which cell is responsible

School A's two cells supply 7.71 of the 12.15, which is a description of the table and not something the test concluded — the alternative only ever claimed a difference somewhere.

Step 10

It cannot tell you which way, either

Swap the two response columns, so school A now runs low where it ran high, and every bar comes back the same length: squaring kept the size of each departure and destroyed its direction.

Step 11

A large p-value never proves independence

When the tail is fat — 0.28 on the df = 10 comparison — the data simply look like what the null produces, which is not the same as showing the two variables are independent.

Step 12

The conditional rates carry what the test lost

Report the yes rates alongside the test — 60%, 45% and 44% — because they carry the size and the direction of the difference that \(\chi^2\) squared away.