Chi-Squared
Test for difference between observed and expected.
This public page keeps the free explanation visible and leaves premium worked solving, advanced walkthroughs, and saved study tools inside the app.
Core idea
Overview
The Chi-squared test for goodness of fit is a statistical measure used in biology to determine if the deviation between observed categorical data and expected theoretical frequencies is significant. It evaluates whether an experimental outcome, such as the phenotypic ratio in a genetic cross, aligns with a specific biological hypothesis.
When to use: Apply this test when analyzing discrete, categorical data to compare observed counts against a predicted distribution, such as Mendelian 3:1 or 9:3:3:1 ratios. It assumes that data points are independent and that the expected frequency in each category is at least five.
Why it matters: It allows biologists to rigorously test genetic models, determining if traits are assorting independently or if they are linked on the same chromosome. It is also essential in ecology for analyzing whether species distributions across different environments are random or influenced by external factors.
Symbols
Variables
= Chi-Squared Contrib, O = Observed, E = Expected
Walkthrough
Derivation
Formula: Chi-Squared Test
Chi-squared tests whether differences between observed and expected frequencies are likely due to chance.
- Data are frequency counts (not percentages).
- Expected frequencies are sufficiently large (commonly each expected value > 5).
- Categories are mutually exclusive.
Define Observed and Expected:
Observed counts come from data; expected counts come from the null hypothesis (e.g., Mendelian ratio).
Compute Chi-Squared:
For each category compute and sum across all categories.
Note: Compare to a critical value using degrees of freedom to decide whether to reject the null hypothesis.
Result
Source: OCR A-Level Biology A — Genetics, Evolution and Ecosystems
Visual intuition
Graph
The graph follows a parabolic shape where the Chi-Squared contribution on the y-axis increases quadratically as the difference between observed and expected values grows. Because the squared term in the numerator dominates, the curve is always non-negative and reaches a minimum value of zero when the observed and expected values are identical.
Graph type: parabolic
Why it behaves this way
Intuition
Imagine comparing two bar charts: one showing your observed data and another showing what you'd expect based on a hypothesis. The Chi-squared value quantifies the total 'mismatch' or 'distance' between these two charts
Signs and relationships
- (O-E)^2: The squaring of the difference ensures that all individual contributions to the statistic are positive, regardless of whether the observed count is higher or lower than the expected.
- Σ: The summation symbol indicates that the Chi-squared statistic is the sum of the individual discrepancies from each category. This aggregates the 'mismatch' across all categories into a single, overall measure of how well
Free study cues
Insight
Canonical usage
The Chi-squared statistic is a dimensionless value used to quantify the discrepancy between observed and expected frequencies in categorical data analysis.
Common confusion
Students often mistakenly try to assign units to observed or expected frequencies, or to the Chi-squared statistic itself. It is crucial to remember that O and E are counts, and the resulting statistic is a pure number
Dimension note
The Chi-squared statistic is inherently dimensionless because it is calculated from ratios of counts. Both observed (O) and expected (E)
Unit systems
One free problem
Practice Problem
Practice Problem 1
In a pea plant cross, a scientist expects 75 plants to exhibit purple flowers based on a 3:1 ratio. However, they observe only 69 purple plants. Calculate the chi-squared contribution (X2) for this specific phenotype category.
Solve for:
Hint: Subtract the expected value from the observed value, square the result, and then divide by the expected value.
Practice Problem 2
A biologist predicts that 40 fruit flies in a sample will have vestigial wings. Upon counting, the researcher finds 50 flies with this trait. What is the chi-squared value (X2) calculated for this single category?
Solve for:
Hint: Square the difference between 50 and 40 before dividing by the expected frequency.
Practice Problem 3
An ecologist expects a specific quadrant to contain 20 units of a rare lichen species, but the actual observation reveals only 14 units. Calculate the chi-squared value (X2) for this observation.
Solve for:
Hint: The numerator should be the square of the difference between the observed 14 and the expected 20.
The full worked solution stays in the interactive walkthrough.
Where it shows up
Real-World Context
When testing genetic cross ratios in offspring, Chi-Squared is used to calculate Chi-Squared Contrib from Observed and Expected. The result matters because it helps judge uncertainty, spread, or evidence before making a conclusion from the data.
Study smarter
Tips
- Always use raw counts of individuals rather than percentages or proportions.
- The Chi-squared value (X²) is the sum of (Observed - Expected)² / Expected for every category.
- A higher X² value indicates a greater discrepancy between your data and the null hypothesis.
Avoid these traps
Common Mistakes
- Forgetting to square (O-E).
- Using totals instead of category values.
Common questions
Frequently Asked Questions
Chi-squared tests whether differences between observed and expected frequencies are likely due to chance.
Apply this test when analyzing discrete, categorical data to compare observed counts against a predicted distribution, such as Mendelian 3:1 or 9:3:3:1 ratios. It assumes that data points are independent and that the expected frequency in each category is at least five.
It allows biologists to rigorously test genetic models, determining if traits are assorting independently or if they are linked on the same chromosome. It is also essential in ecology for analyzing whether species distributions across different environments are random or influenced by external factors.
Forgetting to square (O-E). Using totals instead of category values.
When testing genetic cross ratios in offspring, Chi-Squared is used to calculate Chi-Squared Contrib from Observed and Expected. The result matters because it helps judge uncertainty, spread, or evidence before making a conclusion from the data.
Always use raw counts of individuals rather than percentages or proportions. The Chi-squared value (X²) is the sum of (Observed - Expected)² / Expected for every category. A higher X² value indicates a greater discrepancy between your data and the null hypothesis.
References
Sources
- Wikipedia: Chi-squared test
- Britannica: Chi-squared test
- The Practice of Statistics in the Life Sciences, 4th ed. by Baldi and Moore
- Biometry: The Principles and Practice of Statistics in Biological Research by Robert R. Sokal and F. James Rohlf (4th Edition, 2012)
- Chi-squared test (Wikipedia article)
- OCR A-Level Biology A — Genetics, Evolution and Ecosystems