IB Biology SL Topic 3 — Populations & Communities Paper 1 & 2 Core skill ~12 min read

The Chi-Squared Test

Two species keep turning up in the same quadrats. Is something linking them, or did it just happen? Your eyes are terrible at answering that. The chi-squared test answers it with a number — and it is one of the most predictable calculations in the whole course, so it is worth getting fluent.

📘 What you need to know

What an association looks like

Species are rarely scattered at random. Soil type, water, light and other species all push them into patterns. Two species living in a symbiotic relationship tend to be found side by side. Two species competing for the same resources tend to exclude each other, so they end up in different parts of the habitat.

Three patterns you might see Teal dots are species A, orange dots are species BPOSITIVE NEGATIVE NO ASSOCIATION found together found apart no pattern e.g. mutualism e.g. competition independent speciesThe test decides whether the pattern is real Human eyes find patterns in random data, which is exactly why the test exists.
Careful with the third panel. Random scatter often looks clumped by chance, and that is precisely the illusion the statistics are there to catch.

The two hypotheses

Every chi-squared test starts with a pair of statements, and you must write the right one.

The test does not prove either one. It tells you how likely your results would be if the null hypothesis were true. If they would be very unlikely, you reject the null hypothesis.

The chi-squared equation χ2 = Σ (O − E)2 ÷ E
O = observed value   E = expected value   Σ = sum of
Read the equation as a question: “how far are my results from what chance alone would give?” The (O − E) part measures the gap, squaring removes the minus signs, and dividing by E keeps big categories from dominating just because they are big.

The method, start to finish

🧩 Eleven steps, but only three ideas

  1. Build a contingency table of how many quadrats held one species, both, or neither.
  2. Add row totals, column totals and the overall total.
  3. Calculate each expected value: (row total × column total) ÷ overall total.
  4. Find O − E for every cell. Some will be negative — that is fine.
  5. Square each difference, which removes the negatives.
  6. Divide each squared difference by its own expected value.
  7. Add those results together. That total is your chi-squared value.
  8. Work out the degrees of freedom: (columns − 1) × (rows − 1).
  9. Choose the probability level. Biologists use p = 0.05.
  10. Read the critical value from the table using your degrees of freedom and p.
  11. Compare. Larger than critical means significant; smaller or equal means not.
WORKED EXAMPLE

Are bluebells and wood anemones associated?

A student placed 60 random quadrats in a woodland and recorded the presence or absence of bluebells and wood anemones in each one. Both species were present in 25 quadrats, only wood anemone in 7, only bluebell in 8, and neither in 20. Use a chi-squared test to decide whether there is a significant association.

Contingency tableBluebell presentBluebell absentRow total
Anemone present25732
Anemone absent82028
Column total332760
Step 1: state the null hypothesis there is no significant association between the distributions of bluebells and wood anemones Step 2: expected value for “both present” (32 × 33) ÷ 60 = 17.60 repeat for the other three cells: 14.40, 15.40 and 12.60
CategoryOEO − E(O − E)2(O − E)2 ÷ E
Both species present2517.60+7.4054.763.11
Anemone only714.40−7.4054.763.80
Bluebell only815.40−7.4054.763.56
Neither species2012.60+7.4054.764.35
Step 3: add the final column 3.11 + 3.80 + 3.56 + 4.35 = 14.82 Step 4: degrees of freedom (2 − 1) × (2 − 1) = 1 Step 5: critical value at p = 0.05 with 1 degree of freedom 3.84 Step 6: compare 14.82 is much larger than 3.84 reject the null hypothesis — the association is significant observed “both present” (25) is well above expected (17.6), so it is a positive association
Notice the shortcut. In a 2 × 2 table every (O − E) has the same size, just alternating signs. If your four differences are not all the same number, you have made an arithmetic slip — go back and check the totals.

Critical values and what they mean

Degrees of freedomp = 0.1p = 0.05p = 0.01p = 0.001
12.713.846.6310.83
24.615.999.2113.82
36.257.8111.3416.27
47.789.4913.2818.47

Biologists work at p = 0.05, which means a 5 % probability that a difference this big could have happened by chance alone. Put another way, you can be 95 % confident that the association is real. Fields where mistakes are more costly, such as medical research, use a smaller p-value and demand more certainty.

Making the decision Everything depends on one comparison your chi-squared value LARGER than critical value reject the null hypothesis there IS a significant associationSMALLER or EQUAL accept the null hypothesis any pattern is likely to be due to chanceread the critical value at p = 0.05 with the right degrees of freedom Bigger than critical means the association is significant Degrees of freedom for a 2 by 2 contingency table is always 1.
Write the comparison out in full in your answer: “14.82 is greater than 3.84, so the null hypothesis is rejected.” That sentence usually carries a mark of its own.
WORKED EXAMPLE

When the result is not significant

In a second woodland, 40 quadrats gave a chi-squared value of 0.10 for the same two species. State the degrees of freedom and the conclusion, and explain what the result means in biological terms.

Degrees of freedom (2 − 1) × (2 − 1) = 1, so the critical value is 3.84 Comparison 0.10 is much smaller than 3.84 accept the null hypothesis — no significant association What it means biologically the distributions of the two species are independent of each other any apparent pattern in this woodland is likely to be down to chance

💡 Exam tip

⚠ Common mix-up

That completes Populations & Communities. Up next: Transfers of Energy and Matter — where the food that all of these populations depend on actually comes from, and where it goes.

Want this explained one-to-one?

Book a free session with an experienced IB Biology tutor and get your trickiest topics made simple.

Book a Free Session →