Chi-Square Tests
Perform chi-square tests for goodness of fit, homogeneity, and independence.
Try the Interactive Version!
Learn step-by-step with practice exercises built right in.
Chi-Square Tests
Overview
Chi-square () tests are used for categorical data. There are three types:
| Test | Purpose | |------|---------| | Goodness of Fit | Does a distribution match a claimed distribution? | | Homogeneity | Do different populations have the same distribution? | | Independence | Are two categorical variables independent? |
Chi-Square Test Statistic
Always calculated the same way for all three tests.
1. Goodness of Fit Test
Purpose: Test whether a categorical variable follows a specified distribution.
Hypotheses:
- : The data follows the specified distribution
- : The data does not follow the specified distribution
Degrees of freedom: (where = number of categories)
Expected counts: (sample size × hypothesized proportion)
2. Test for Homogeneity
Purpose: Test whether the distribution of a categorical variable is the same across different populations.
Hypotheses:
- : The distributions are the same for all populations
- : The distributions are not all the same
Degrees of freedom:
Expected counts:
3. Test for Independence
Purpose: Test whether two categorical variables are independent within a single population.
Hypotheses:
- : The two variables are independent
- : The two variables are not independent
Degrees of freedom:
Expected counts: Same formula as homogeneity
Conditions for All Chi-Square Tests
- Random: Data from a random sample or randomized experiment
- 10%:
- Large Counts: All expected counts
Properties of the Chi-Square Distribution
- Always
- Right-skewed (becomes less skewed as increases)
- P-value is always from the right tail
- Different shape for each
Follow-Up Analysis
If you reject , identify which cells contribute most to by examining: for each cell. Large contributions indicate where the biggest discrepancies are.
AP Tip: Chi-square tests are ALWAYS right-tailed. There is no "left-tailed" or "two-tailed" chi-square test. Show expected counts and verify they are all ≥ 5.
📚 Practice Problems
No example problems available yet.