
IB Biology Chi-Squared Test: Steps, Example and Exam Tips
The chi-squared test (χ²) tells you whether the gap between what you observed and what you expected is just chance or a real difference. You use it on counts in categories, such as phenotypes or species in a habitat, never on means or percentages. You calculate χ², find the degrees of freedom, compare with the critical value at the 0.05 level, and write a conclusion in context. At Tiber Tutor, our IB Biology content is written by IB examiners, so this guide follows the way marks are actually awarded.
TL;DR
- Use chi-squared when your data are counts in categories and you can state an expected result.
- The formula is χ² = Σ (O − E)² / E, and degrees of freedom for goodness of fit are the number of categories minus one.
- If your calculated χ² is greater than the critical value at 0.05, reject the null hypothesis. If it is smaller, you fail to reject it.
- Always finish with a sentence in context: what the result means for the organisms or the investigation.
- Practise on exam-style questions and examiner mark schemes so the wording becomes automatic.
Table of Contents
- What the chi-squared test does
- Goodness of fit or test of association?
- The calculation, step by step
- A worked example
- Conditions to check before you use it
- What to write when the result is close
- Common mistakes that lose marks
- How to practise so it sticks
- Try it with the full platform
- FAQ
- Sources
What the chi-squared test does
The test compares observed results with expected results and helps you decide whether the difference is due to chance. WJEC’s biology teaching resource says it suits nominal data, such as phenotypes, where your observations are real counts rather than percentages and the expected values can be worked out, for example from a Mendelian ratio.
In IB Biology that usually means two kinds of situation:
- Genetics: do offspring numbers fit a ratio such as 3:1, 1:1 or 9:3:3:1?
- Ecology and behaviour: do organisms choose one side of a choice chamber equally, or do two species occur together more than chance predicts?
Pearson’s mathematics support for biology students points to the same uses: Mendelian ratios and choice-chamber or prey-selection experiments.
Goodness of fit or test of association?
There are two versions you will meet most often. The question you are asking decides which one you use.
| Goodness of fit | Test of independence (association) | |
|---|---|---|
| Variables | One categorical variable | Two categorical variables |
| Question | Do my counts match an expected ratio? | Are the two variables linked? |
| Biology example | Flower colours against a 1:2:1 ratio | Whether two species are found together in a habitat |
| Null hypothesis | The data fit the expected distribution | The variables are independent |
The table follows the distinction in OpenStax Introductory Statistics and the biological statistics guide from the University of Delaware. One IB-focused US school library guide gives a quick rule: use a t-test to compare datasets, a chi-squared test to check whether data sets are independent (for instance whether two genetic traits assort independently), and a correlation coefficient for correlation.
For a test of association, degrees of freedom are (rows − 1) × (columns − 1), as Cornell’s statistics guide sets out.
The calculation, step by step
- State the hypotheses. The null hypothesis says there is no significant difference between observed and expected results. The alternative says there is.
- Work out the expected values. Multiply the total count by each expected proportion. Observed and expected totals must be the same, as this US teacher’s IB unit stresses.
- Calculate (O − E)² / E for each category, then add them up. That sum is χ².
- Find the degrees of freedom. For goodness of fit, it is the number of categories minus one. Three genotypes give df = 2, because once two frequencies are fixed the third is determined, as the National Institute of Justice explains for Hardy–Weinberg.
- Compare with the critical value at p = 0.05. Biologists use the 5% threshold, according to WJEC. If your χ² is greater than the critical value, reject the null hypothesis.
- Write the conclusion in context.
A χ² of 0 means a perfect match, and larger values mean a greater deviation from expectation, as this genetics course from UMass Boston puts it.
A worked example
The UMass Boston course gives a clear genetics case. A cross was expected to give normal and tail-less mice in a 3:1 ratio. There were 229 offspring: 139 normal and 90 tail-less.
| Phenotype | Observed (O) | Expected (E) | (O − E)² / E |
|---|---|---|---|
| Normal | 139 | 171.75 | 6.24 |
| Tail-less | 90 | 57.25 | 18.73 |
| Total | 229 | 229 | 24.98 |
There are two categories, so df = 1. The result of 24.98 gives p < 0.005, so the null hypothesis is rejected. The deviation from 3:1 is not due to chance. The course goes on to explain the reason: embryonic lethality in one genotype.
A model conclusion would read: The calculated χ² of 24.98 is greater than the critical value at p = 0.05 with 1 degree of freedom, so the null hypothesis is rejected. The ratio of normal to tail-less mice differs significantly from 3:1.
Now the opposite outcome. In the same Pearson support notes, 128 fruit flies were tested against a 9:3:3:1 ratio. With df = 4 − 1 = 3, the calculated χ² was 1.9, which is less than the critical value at p = 0.05. The results fit the ratio.
Notice what you may and may not say. A small χ² means you have no evidence against the expected ratio. It does not prove the ratio is correct.

Conditions to check before you use it
The test is only valid when its assumptions hold. Statistics course notes from Cerritos College name two: expected frequencies must be large enough, and observations must be independent. Cornell’s guide adds a practical rule for association tests: expected counts of 5 or more in at least 80% of cells, and no cell below 1.

In an IA, this changes how you plan. Collect enough counts, and make sure each organism or trial is counted only once. Check the examiner checks for data analysis before you finalise your method.
What to write when the result is close
When χ² sits near the critical value, say so. WJEC notes that results such as 7.91 against a critical value of 7.82 reduce confidence in the decision, and repeating the experiment is sensible because biased sampling could lead to a wrong conclusion. Examiners reward a student who comments on reliability and sampling, not only one who reaches “reject” or “fail to reject”.
The Texas Instruments IB lesson sets the same expectations: recognise that the test is for counts of categorical data, choose the right version, find the degrees of freedom, and write the conclusion in context.
Common mistakes that lose marks
- Using percentages instead of counts. The test needs actual numbers.
- Expected values that do not add to the observed total. Check this before you go any further.
- Wrong degrees of freedom. Count categories, then subtract one.
- Saying “accept the null hypothesis”. Prefer “fail to reject”.
- No context. Name the organisms, the ratio and the trait in your final sentence.
- Graphs that do not match the test. Counts in categories usually suit bar charts, and our guide to choosing and drawing IB Biology graphs shows how.
How to practise so it sticks
The calculation is short enough to do by hand. The teacher behind the raptor unit suggests starting with the colours in a bag of sweets before moving to real data. The marks, however, come from choosing the right test and phrasing the conclusion well, and that takes repeated, exam-style practice.
On Tiber Tutor, the exam-style questions, animated videos, notes, flashcards and topic tests link together, so a weak area found in a test leads straight to the matching explanation. Our IB Biology topic tests and custom test builder let you drill the data-handling and genetics skills you need, and the student-led answer review checks your wording against examiner mark schemes.
Our perspective
Chi-squared is a small topic that decides a surprising number of marks, in papers and in the IA. Students rarely fail at the arithmetic. They slip on choosing the test, on the degrees of freedom, and on the final sentence in context.
That is why we build our resources around how examiners mark. Our questions and mark schemes are written by actual IB examiners, and every piece connects to the others: a question, its video, its notes and its flashcards. Our progress tracking and performance analytics show which skills need work, so practice time goes where it counts.
We believe this combination of examiner-authored material, polish and insight gives IB students the best value for money in IB STEM. A student who sees their own patterns of error improves faster, and gains confidence along the way.
Oliver
Try it with the full platform
Tiber Tutor covers IB Biology, Chemistry, Physics and IB Maths, with examiner-written questions, mock exams and performance analytics in one place. You can start with a free 7-day trial. The Per-Subject Plan is $9 per month and the All-Access Plan is $19 per month. See the plans and pricing, or explore the IB Biology mock exams to rehearse the full paper.
Parents and teachers can see how the platform supports a class or a student on our pages for IB parents and for IB students.
FAQ
When do I use chi-squared instead of a t-test in IB Biology?
Use chi-squared when your data are counts in categories, such as phenotypes or presence in a habitat. Use a t-test when you compare the means of two sets of measurements. The choice depends on the type of data you collected.
How do I find the degrees of freedom?
For goodness of fit, subtract one from the number of categories. Four phenotypes give df = 3. For a test of association in a table, multiply (rows − 1) by (columns − 1).
What does it mean if χ² is bigger than the critical value?
The difference between observed and expected results is unlikely to be due to chance at the 0.05 level, so you reject the null hypothesis. State what this means for your organisms or experiment. A smaller value means you fail to reject the null hypothesis.
Can I use chi-squared with percentages?
No. The test needs actual counts. If you have percentages, convert them back to the original numbers before you calculate expected values.
Sources
- WJEC Blended Learning: Inheritance
- Pearson: Biology mathematics support
- OpenStax: Comparison of the Chi-Square Tests
- Statistics LibreTexts: Choosing the Right Test
- West Sound Academy: Recording and Analyzing Data
- Cornell: Interpreting contingency tables
- Charlotte Teachers Institute: Teaching Statistics with Raptors in IB Biology
- National Institute of Justice: Hardy–Weinberg Principle
- UMass Boston: The chi-squared Test
- Cerritos College: Categorical data summary
- Texas Instruments: Chi-Squared Tests
