BiologyStatisticsA-Level
CambridgeOCREdexcelWJECAbiturAPAQABaccalauréat Général

Chi-Squared

Test for difference between observed and expected.

Understand the formulaSee the free derivationOpen the full walkthrough

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

Chi-Squared Contrib
Variable
Observed
Variable
Expected
Variable

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.
1

Define Observed and Expected:

Observed counts come from data; expected counts come from the null hypothesis (e.g., Mendelian ratio).

2

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

The Chi-squared statistic, a quantitative measure of the discrepancy between observed and expected frequencies.
A larger value indicates a greater overall difference between the observed data and what was predicted by the hypothesis, suggesting the hypothesis may not fit the data well.
The observed frequency or count in a specific category from experimental data.
This is the actual number of times an event or outcome occurred in your experiment.
The expected frequency or count in a specific category, calculated based on a null hypothesis or a theoretical model.
This is the number of times you would theoretically expect an event or outcome to occur if your hypothesis (e.g., Mendelian ratios) were perfectly true.
The squared difference between the observed and expected counts for a single category.
This term quantifies how 'off' your observation was from your expectation for a given category. Squaring ensures that the deviation is always positive, regardless of whether O is greater or less than E, and gives
The contribution of a single category to the total Chi-squared value, normalized by the expected frequency.
This term weighs the squared deviation by the expected count. A given absolute difference (O-E) has a much larger impact on if the expected count (E)

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

count - Represents the observed frequency or number of observations in a specific category. It is a discrete, non-negative integer.
count - Represents the expected frequency or theoretically predicted number of observations in a specific category. It can be a non-negative real number.
dimensionless - The calculated Chi-squared test statistic, which is a pure number used for statistical comparison against critical values from a Chi-squared distribution.

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.

Observed69
Expected75

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?

Observed50
Expected40

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.

Observed14
Expected20

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

  1. Wikipedia: Chi-squared test
  2. Britannica: Chi-squared test
  3. The Practice of Statistics in the Life Sciences, 4th ed. by Baldi and Moore
  4. Biometry: The Principles and Practice of Statistics in Biological Research by Robert R. Sokal and F. James Rohlf (4th Edition, 2012)
  5. Chi-squared test (Wikipedia article)
  6. OCR A-Level Biology A — Genetics, Evolution and Ecosystems