AP Statistics Chi-Square Tests Lesson: Notes and Examples (Free PDF)

Chi square test lesson – Maths PDFCover of the book AP Statistics Math Lessons (PDF)Download as a PDFThe AP Statistics math lessons bookPrintable PDFSee the book ›


This chi square test lesson for AP Statistics covers chi-square tests (Common Core AP STAT 8.1, AP STAT 8.2, AP STAT 8.3, AP STAT 8.4, AP STAT 8.5, AP STAT 8.6, AP STAT 8.7), with a free PDF to print.

Key takeaway: This lesson helps AP Statistics students carry out chi-square tests for goodness-of-fit, homogeneity, and independence.

  • Topic: Chi-Square Tests (AP Statistics)
  • Content: One-page lesson with a definition, a worked example and key facts
  • Standards: AP STAT 8.1, AP STAT 8.2, AP STAT 8.3, AP STAT 8.4, AP STAT 8.5, AP STAT 8.6, AP STAT 8.7
  • Answers: Explanations included
  • Format: Free printable PDF, US Letter, black and white

Key takeaway: A clear AP Statistics lesson on Chi-Square Tests, with definitions, rules and worked examples: what is a chi-square test, how does a goodness-of-fit test work and how do you test two categorical variables. Read it before the practice worksheet; free to print or download as a PDF.

A chi-square test compares observed counts with the counts expected under the null hypothesis, using the sum of (O – E)^2/E and a p-value. Goodness-of-fit has df = categories – 1; a two-way table has E = row total times column total over grand total and df = (r – 1)(c – 1). Expected counts must be at least 5.

This lesson helps AP Statistics students carry out chi-square tests for goodness-of-fit, homogeneity, and independence. You learn to compute expected counts, find the chi-square statistic, and state a conclusion in context.

First, the lesson explains what the statistic measures: the distance between observed and expected counts. Next, it shows the goodness-of-fit test for one categorical variable. Then it shows how to find expected counts in a two-way table and how to count degrees of freedom. After that, it explains the conditions, including expected counts of at least 5. Finally, it distinguishes homogeneity from independence. Plan about 45 minutes.

AP Statistics · Common Core State Standards: AP STAT 8.1, AP STAT 8.2, AP STAT 8.3, AP STAT 8.4, AP STAT 8.5, AP STAT 8.6, AP STAT 8.7

Key facts in this chi square test lesson

Key facts
  • chi-square = sum of (O – E)^2 / E; right-tailed p-value; distribution skewed right.
  • Goodness-of-fit: one categorical variable; df = number of categories – 1.
  • Two-way table: E = row total x column total / grand total; df = (r – 1)(c – 1).
  • Conditions: random sample or random assignment, and all expected counts at least 5.
  • Homogeneity: compare distributions across groups; independence: two variables in one sample.

What is a chi-square test?

A chi-square test compares observed counts in categories with the counts we would expect if a claim were true. The test statistic adds up the squared differences, scaled by the expected counts:

\[\chi^{2}=\sum\frac{(O-E)^{2}}{E}\]

Large values of \(\chi^{2}\) mean the data are far from what the null hypothesis predicts. The p-value is the area to the right of \(\chi^{2}\) under a chi-square distribution with the appropriate degrees of freedom. These distributions are skewed right.

How does a goodness-of-fit test work?

A goodness-of-fit test checks whether one categorical variable has a claimed distribution. Example: a manager claims that late arrivals are equally likely on each of 5 weekdays. In 250 late arrivals, the counts are 58, 48, 44, 42, 58.

CategoryObservedExpectedMon5850Tue4850Wed4450Thu4250Fri5850
Goodness-of-fit setup: expected counts are 250 times each hypothesized proportion.
  • \(H_0\): the proportion of late arrivals is 0.20 on each weekday. \(H_a\): at least one proportion differs.
  • Conditions: random sample, and all expected counts at least 5 (here 50 each).
  • \(\chi^{2}=\frac{(58-50)^{2}}{50}+\frac{(48-50)^{2}}{50}+\frac{(44-50)^{2}}{50}+\frac{(42-50)^{2}}{50}+\frac{(58-50)^{2}}{50}=4.64\) with \(df=5-1=4\).
036912154.64chi-square
The chi-square distribution is skewed right; the p-value is the area to the right of 4.64 (about 0.326).

The p-value is \(0.3263\), greater than 0.05, so we fail to reject \(H_0\). There is not convincing evidence that late arrivals are unevenly distributed across weekdays.

How do you test two categorical variables?

For a two-way table, the expected count in each cell is \(E=\frac{\text{row total}\times\text{column total}}{\text{grand total}}\), and \(df=(r-1)(c-1)\). The same formula gives \(\chi^{2}\). Use a test for homogeneity when comparing the distribution of one variable across several populations or treatments, and a test for independence when you classify one sample by two variables.

LibraryHomeCafeTotalSophomore304525100Senior503515100Total808040200
Observed counts of study location by class (two-way table).
LibraryHomeCafeTotalSophomore30 (40.0)45 (40.0)25 (20.0)100Senior50 (40.0)35 (40.0)15 (20.0)100Total808040200
Observed (expected) counts. Expected = row total times column total over grand total.

Here \(\chi^{2}=8.75\), \(df=(2-1)(3-1)=2\), and the p-value is \(0.0126\). Since this is less than 0.05, we reject \(H_0\): there is convincing evidence of an association between class and study location (the seniors prefer the library more than the sophomores do).

One categoricalvariable, onesampleGoodness-of-fitTwo variables orgroups(two-way table)Homogeneity orindependence
Choosing the test.

Chi square test lesson: questions and answers

What does a large chi-square statistic mean?

It means the observed counts differ greatly from the expected counts under H0. The larger the statistic, the smaller the p-value and the stronger the evidence against H0.

What is the condition for using a chi-square test?

The data must come from a random sample or randomized experiment, and every expected count must be at least 5. Observed counts may be small, but expected counts may not.

What is the difference between homogeneity and independence?

Homogeneity compares the distribution of one categorical variable across several separate populations or treatments. Independence asks whether two categorical variables are related in a single sample. The calculation is identical; the wording of the hypotheses differs.

How do I find the degrees of freedom?

For goodness-of-fit, df is the number of categories minus 1. For a two-way table, df is (number of rows – 1) times (number of columns – 1).

Which cells contribute the most to chi-square?

Compute (O – E)^2 / E for each cell. The largest contributions show where the data differ most from H0, which is useful in your conclusion.

Common mistakes with this chi square test lesson

  • Students use observed counts to check the large-count condition. However, the condition applies to expected counts, so compute them first.
  • Students use a two-tailed p-value. Because the chi-square statistic is never negative and large values are the evidence, use the right tail only.
  • Students conclude that the null hypothesis is true when the p-value is large. Instead, say that the data do not provide convincing evidence against it.

How to study this chapter

  • First, write the null and alternative hypotheses in context before any computation. Then name the test and check its conditions.
  • Also, compute the contribution of each cell. Then you can say which categories drive a large statistic.
  • Parents can ask the student to explain, in plain words, what it means when observed counts are far from expected counts.

Download the chi square test lesson as a PDF with the button below and keep it with your notes.

More questions about chi square test lesson

Why is the chi-square distribution skewed right?

The statistic is a sum of squared terms, so it cannot be negative, and it has a long tail to the right. With more degrees of freedom, the curve becomes more symmetric. The test uses only the right tail.

Can I use a chi-square test with percents instead of counts?

No. The test needs counts, because the size of the sample affects the evidence. Percents hide the sample size. Convert percents back to counts before you compute expected counts and the statistic.

What does a small p-value tell you in a chi-square test?

It says that, if the null hypothesis were true, a statistic this large or larger would be unlikely. So the data provide convincing evidence against the null hypothesis. State the conclusion in the context of the variables.

All AP Statistics chapters: AP Statistics math.

Voter.. post

Free printable PDF

AP Statistics Chi-Square Tests Lesson: Notes and Examples

US Letter71 KBPrints in black and white

Download PDF

More AP Statistics math

Lessons

See all

Worksheets

See all

Tests

See all

Quizzes

See all