Topic 8.6 Notes – Carrying Out a Chi-Square Test for Homogeneity or Independence
The Chi-Square Test Statistic
In both a test of independence (one population, two categorical variables) and a test of homogeneity (multiple populations, one categorical variable), the math is identical.
We compare what we observed (O) in each cell of a two-way table to what we would expect (E) if the null hypothesis were true.
If is true:
- Independence → no association between variables
- Homogeneity → same distribution across populations
Either way, expected counts come from assuming “no relationship.”
The Formula
What each part means:
- = observed count in a cell
- = expected count for that cell
- Add this value for every cell in the table
Why this structure?
- measures deviation.
- Squaring makes everything positive.
- Dividing by adjusts for cell size.
- Bigger overall deviations → bigger .
Important: . It can’t be negative.
On your calculator, this is done with the χ²-Test feature, but the AP exam expects you to understand what that number represents.
Degrees of Freedom
The chi-square distribution depends on degrees of freedom, which come from the table size:
Example:
A 4 × 3 table gives
More rows or columns → larger df → distribution becomes less skewed.
For example, here is a chi-square distribution with :
Chi-square distribution (df = 5)
The curve is right-skewed, and all possible values are at or to the right of 0. That matters when we interpret the p-value.
Finding the P-Value
Once you have:
- Your test statistic
- Your degrees of freedom
You find the area to the right of your test statistic on the chi-square distribution.
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 observed.
Two things to lock in:
- It is always a right-tailed test.
- Larger → smaller p-value.
You’ll usually use technology, but you need to know that the calculator is finding a right-tail probability using the correct df.
Making a Decision
The decision rule is the same as other hypothesis tests:
- If p ≤ α → Reject
- If p > α → Fail to reject
Never say “accept the null.” That loses points every time.
Writing the Conclusion in Context
This is where students lose easy credit. Your conclusion must connect back to the actual variables and population.
Step 1 Decision statement
“Since p = 0.012 is less than α = 0.05, we reject .”
Step 2 Context statement
For independence:
There is convincing evidence of an association between study method and course outcome for students at this school.
For homogeneity:
There is convincing evidence that the distribution of preferred social media platform differs among teenagers, adults, and seniors.
Notice:
- Variables are named.
- Population is identified.
- We say “association” or “distribution differs.”
- We do not claim causation.
Interpreting the P-Value Correctly
Be precise. On an FRQ, a correct interpretation sounds like this:
If there is truly no association between pet ownership and apartment type in the population, there is a 3.4% chance of obtaining a chi-square statistic at least as large as the one observed from this sample.
It is not:
- The probability the null is true.
- The probability the alternative is true.
- The probability we made a mistake.
It’s conditional on being true.
Big Picture Logic
Chi-square tests measure how far the observed counts are from what we’d expect under “no relationship.”
- Small deviations → small → large p-value → not convincing.
- Large deviations → large → small p-value → convincing evidence of association or different distributions.
Everything revolves around comparing observed vs. expected counts and seeing whether the differences are too large to attribute to chance alone.
Key Takeaways
Chi-Square Statistic for Homogeneity or Independence
Sum (Observed minus Expected) squared divided by Expected over all table cells.
Degrees of Freedom for a Two-Way Table
Calculated as (number of rows minus 1)(number of columns minus 1).
Observed Counts and Expected Counts
Observed counts come from data; expected counts are counts predicted if the null hypothesis is true.
Finding a Chi-Square P-Value
Use the chi-square distribution with the correct degrees of freedom in a table or technology.
Decision Rule Using Alpha
Reject the null if p-value is less than alpha; otherwise fail to reject it.
Conclusion for a Chi-Square Test of Independence vs Homogeneity
Independence: evidence of association; homogeneity: evidence distributions differ across populations.
Contextual Conclusion in a Chi-Square Test
State the decision and evidence in terms of the variables or populations studied.
Do Not Accept the Null Hypothesis
A non-significant result means fail to reject the null, not prove it true.
Chi-Square P-Value
The probability, assuming the null is true, of a chi-square value at least as large observed.
Notes
Chi-Square Statistic for Homogeneity or Independence
Sum (Observed minus Expected) squared divided by Expected over all table cells.
Degrees of Freedom for a Two-Way Table
Calculated as (number of rows minus 1)(number of columns minus 1).
Observed Counts and Expected Counts
Observed counts come from data; expected counts are counts predicted if the null hypothesis is true.
Finding a Chi-Square P-Value
Use the chi-square distribution with the correct degrees of freedom in a table or technology.
Decision Rule Using Alpha
Reject the null if p-value is less than alpha; otherwise fail to reject it.
Conclusion for a Chi-Square Test of Independence vs Homogeneity
Independence: evidence of association; homogeneity: evidence distributions differ across populations.
Contextual Conclusion in a Chi-Square Test
State the decision and evidence in terms of the variables or populations studied.
Do Not Accept the Null Hypothesis
A non-significant result means fail to reject the null, not prove it true.
Chi-Square P-Value
The probability, assuming the null is true, of a chi-square value at least as large observed.