Chi-Square Explanation (AP Bio)
Chi-square (χ²) tests whether observed counts differ from expected counts more than you'd expect by chance.
Important definitions to understand
- Null hypothesis (H₀): a hypothesis that states that the variables (or things being changed in an experiment) will not result in a real difference; deviations are due to random chance.
- Observed (O): what you actually counted.
- Expected (E): the counts you'd expect if H₀ were true.
- χ² statistic: sum of (O−E)²/E across categories; larger values mean observed counts are farther from expectations.
- Degrees of freedom (df): number of categories − 1.
- p-value: probability of seeing data as extreme as yours if H₀ is true.
The formula
χ² = Σ (O − E)² / E
Compute each category's (O−E)²/E, then add them.
Simple example — coin toss
Suppose you expect a fair coin (50/50) but observe 60 heads and 40 tails (N = 100).
Observed
Heads: 60
Tails: 40
Total N: 100
Expected (50:50)
Heads: 50
Tails: 50
Compute χ² contributions
| Category | O | E | (O−E)²/E |
|---|---|---|---|
| Heads | 60 | 50 | 2.000 |
| Tails | 40 | 50 | 2.000 |
χ² ≈ 4.000 — with df = 1
A larger χ² means observed counts are farther from expected; compare to a table or compute a p-value to decide.
Relating these definitions to the coin toss example
- Null hypothesis (H₀): a hypothesis that states that the variables (or things being changed in an experiment) will not result in a real difference; deviations are due to random chance. For the coin toss example H₀ is: the coin is fair (50/50).
- Observed (O): 60 heads, 40 tails — these are the counts you actually recorded.
- Expected (E): 50 heads, 50 tails if the coin is fair.
- χ²: computes how far 60/40 is from 50/50 by summing (O−E)²/E for heads and tails.
- df: categories − 1 = 1 for a two-outcome coin toss.
- p-value: the probability of seeing a 60/40 (or more extreme) result if the coin is fair; a small p suggests the coin may not be fair.