AP Statistics Chi-Square Tests Lesson: Notes and Examples (Free PDF)
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
- 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.
- \(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\).
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.
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).
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.
More AP Statistics math
Lessons
See allSampling Distributions and the Central Limit Theorem Lesson: Notes and Examples
Two Categorical Variables and Two-Way Tables Lesson: Notes and Examples
Significance Tests for a Proportion Lesson: Notes and Examples
Inference for the Difference of Two Proportions Lesson: Notes and Examples
Inference for the Difference of Two Means Lesson: Notes and Examples
Inference for the Slope of a Regression Line Lesson: Notes and Examples
Worksheets
See allExperimental Design and Random Assignment Worksheets with Answers
Chi-Square Tests Worksheets with Answers
Mean, Median, Standard Deviation and Outliers Worksheets with Answers
Confidence Intervals for a Proportion Worksheets with Answers
Inference for the Difference of Two Proportions Worksheets with Answers
Sampling Methods and Bias in Surveys Worksheets with Answers
Tests
See allRandom Variables, Expected Value and Combining Variables Test with Answer Key
t Intervals and t Tests for a Mean Test with Answer Key
Conditional Probability and Independence Test with Answer Key
Sampling Methods and Bias in Surveys Test with Answer Key
Mean, Median, Standard Deviation and Outliers Test with Answer Key
Inference for the Difference of Two Means Test with Answer Key
Quizzes
See allMean, Median, Standard Deviation and Outliers Quiz: 10 Questions with Answers
Probability Rules and Simulation Quiz: 10 Questions with Answers
Variables and Categorical Data Displays Quiz: 10 Questions with Answers
Experimental Design and Random Assignment Quiz: 10 Questions with Answers
Inference for the Difference of Two Proportions Quiz: 10 Questions with Answers
Sampling Methods and Bias in Surveys Quiz: 10 Questions with Answers

























