How to Do a Chi Square Test for AP Biology
What You Need to Know
What it is (and why AP Bio loves it)
A chi-square test (usually a goodness-of-fit test in AP Biology) checks whether your observed results are close enough to your expected results that any difference could reasonably be due to random chance.
You’ll use it most often for:
- Mendelian genetics crosses (do offspring counts fit a , , , etc.?)
- Hardy–Weinberg genotype frequencies (do observed genotypes match expected ?)
- Any categorical data where you have predicted proportions.
Key idea: Chi-square doesn’t “prove” your expected ratio is correct. It tests whether the deviation from expectation is small enough to be explained by chance.
The core formula
You compute the test statistic:
- = observed count in a category
- = expected count in that category
- Sum across all categories
Hypotheses (what you’re actually claiming)
- Null hypothesis : Any difference between observed and expected is due to chance (the model fits).
- Alternative hypothesis : The difference is not due to chance (the model does not fit).
Decision rule (AP Bio style)
You compare your value to a critical value from a chi-square table using:
- degrees of freedom
- a significance level, usually
If is **greater than or equal to** the critical value, you **reject** .
If is **less than** the critical value, you **fail to reject** .
“Fail to reject” is the correct wording (not “accept”).
Step-by-Step Breakdown
The full workflow (what to do on an FRQ)
State the hypotheses clearly.
- : Observed counts match the expected ratio; deviations are due to chance.
- : Observed counts do not match the expected ratio; deviations are not due to chance.
Write the expected ratio or expected probabilities.
Examples: , , , etc.Compute expected counts for each category.
- Find total .
- Convert ratio to proportions and multiply by .
If ratio is with sum , then for each category:
Make a quick table and calculate each term.
Use columns: category | | | | | .Sum to get .
Find degrees of freedom.
For goodness-of-fit:
where = number of categories (phenotypes or genotypes you’re counting).Choose (usually ) and get the critical value.
Use the chi-square table at and your .Compare and conclude in words (biological meaning).
- If : reject → results do not fit expectation; something besides chance likely affected outcomes.
- If : fail to reject → results fit expectation; deviations likely due to chance.
Mini worked walkthrough (annotated)
Suppose a monohybrid cross expects purple:white. You observe purple and white.
- Total
- Expected counts: purple ; white
Compute:
- Purple term:
- White term:
So:
Degrees of freedom: .
Critical value at , is .
Since , **reject** .
Key Formulas, Rules & Facts
Formulas and definitions
| Item | Formula | When to use | Notes |
|---|---|---|---|
| Chi-square statistic | Goodness-of-fit for categorical counts | Bigger = bigger mismatch | |
| Expected count from ratio | Mendelian ratios (e.g., ) | Compute before chi-square | |
| Degrees of freedom | Chi-square goodness-of-fit | = number of categories | |
| Decision rule | Compare to critical value at and | Most AP Bio problems | If → reject |
Common critical values (most used on AP Bio)
(These are for .)
If your table gives ranges or multiple values, AP Bio typically expects unless stated otherwise.
Assumptions / conditions you should check
- Counts, not percentages (convert to counts if needed).
- Categories are mutually exclusive (each observation fits one category).
- Observations are independent (one offspring doesn’t determine another).
- Expected counts should not be too small; a common rule is each (AP-level expectation: “expected values should be sufficiently large”).
Examples & Applications
Example 1: Monohybrid cross (fits expectation)
A cross predicts phenotype ratio. Observed: purple , white .
- Total
- Expected: purple ; white
Compute terms:
- Purple:
- White:
, critical .
Since , **fail to reject** → data are consistent with .
Example 2: Dihybrid cross (fits expectation)
Expected ratio for 4 phenotypes; total .
Observed counts: .
Expected counts:
Compute only nonzero differences:
- Third category:
- Fourth category:
, critical .
Since , **fail to reject** .
Example 3: Monohybrid cross (reject expectation)
Observed: dominant phenotype, recessive phenotype; expected .
- Expected: and
- ; critical
Since , **reject** → likely not a outcome (or some non-random factor impacted results).
Example 4: Hardy–Weinberg genotype fit
A population has allele frequencies and . Total individuals .
Expected genotypes:
- →
- →
- →
Observed genotypes: , , .
Compute:
; critical at is .
Since , **reject** → observed genotype frequencies significantly deviate from HW expectations.
Common Mistakes & Traps
Mixing up observed and expected
- Wrong: Plugging observed values into the expected column or vice versa.
- Why it matters: The whole statistic is based on differences .
- Fix: Always compute from the _ratio/probability_ first, then compare to .
Using the ratio numbers as expected counts without scaling
- Wrong: Treating as expected counts even when .
- Fix: Convert ratio to fractions of the total and multiply by .
Forgetting to square the difference (or squaring after dividing)
- Wrong: Using or doing .
- Correct: (square first, then divide).
Incorrect degrees of freedom
- Wrong: Using (sample size) or df = \text{#traits}-1.
- Correct: where is the number of categories you actually have counts for.
Saying “accept the null”
- Wrong: “We accept .”
- Why it’s wrong: Statistics doesn’t prove ; it only assesses evidence against it.
- Fix: Say fail to reject .
Using the wrong chi-square table column (wrong )
- Wrong: Comparing to a column when the problem expects .
- Fix: Default to unless the prompt specifies otherwise.
Rounding too aggressively mid-calculation
- Wrong: Rounding each term heavily (e.g., to whole numbers).
- Fix: Keep a few decimals for each term; round at the end.
Ignoring small expected counts
- Issue: If some values are very small, the chi-square approximation becomes less reliable.
- Fix (AP-level): Note it as a limitation, or (if allowed) combine rare categories logically.
Memory Aids & Quick Tricks
| Trick / mnemonic | What it helps you remember | When to use it |
|---|---|---|
| “O–E, square, over E, then sum” | The exact structure of | Any chi-square computation |
| “df = boxes − 1” | where = number of categories | Choosing the right row in the table |
| “Big chi = bye null” | Large means poor fit → reject | Interpreting results quickly |
| Ratio → fractions → counts | Convert expected ratios to expected counts correctly | Genetics crosses with a ratio |
| Table-first habit | Prevents arithmetic/sign errors by organizing terms | FRQs and multi-category problems |
Quick Review Checklist
- You can state (chance explains differences) and (chance doesn’t).
- You can compute expected counts using .
- You can calculate correctly (square first).
- You can find using the number of categories.
- You can use and compare to the correct critical value.
- You conclude using: reject or **fail to reject** (in context).
- You check that expected counts are reasonably large (ideally ).
You’ve got this—if you can set up the table cleanly, the rest is just careful arithmetic.