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
Species can show a positive association (found together), a negative association (found apart), or no association (independent).
The null hypothesis always says there is no significant association between the two species.
Record presence and absence in a contingency table using randomly placed quadrats.
Expected values come from (row total × column total) ÷ overall total.
Degrees of freedom = (columns − 1) × (rows − 1). For a 2 × 2 table that is 1.
If the chi-squared value is larger than the critical value at p = 0.05, reject the null hypothesis.
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.
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.
Null hypothesis: there is no significant association between the distributions of the two species.
Alternative hypothesis: there is a significant association between the distributions of the two species.
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
Build a contingency table of how many quadrats held one species, both, or neither.
Add row totals, column totals and the overall total.
Calculate each expected value: (row total × column total) ÷ overall total.
Find O − E for every cell. Some will be negative — that is fine.
Square each difference, which removes the negatives.
Divide each squared difference by its own expected value.
Add those results together. That total is your chi-squared value.
Work out the degrees of freedom: (columns − 1) × (rows − 1).
Choose the probability level. Biologists use p = 0.05.
Read the critical value from the table using your degrees of freedom and p.
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 table
Bluebell present
Bluebell absent
Row total
Anemone present
25
7
32
Anemone absent
8
20
28
Column total
33
27
60
Step 1: state the null hypothesisthere is no significant association between the distributions of bluebells and wood anemonesStep 2: expected value for “both present”(32 × 33) ÷ 60 = 17.60repeat for the other three cells: 14.40, 15.40 and 12.60
Category
O
E
O − E
(O − E)2
(O − E)2 ÷ E
Both species present
25
17.60
+7.40
54.76
3.11
Anemone only
7
14.40
−7.40
54.76
3.80
Bluebell only
8
15.40
−7.40
54.76
3.56
Neither species
20
12.60
+7.40
54.76
4.35
Step 3: add the final column3.11 + 3.80 + 3.56 + 4.35 = 14.82Step 4: degrees of freedom(2 − 1) × (2 − 1) = 1Step 5: critical value at p = 0.05 with 1 degree of freedom3.84Step 6: compare14.82 is much larger than 3.84reject the null hypothesis — the association is significantobserved “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 freedom
p = 0.1
p = 0.05
p = 0.01
p = 0.001
1
2.71
3.84
6.63
10.83
2
4.61
5.99
9.21
13.82
3
6.25
7.81
11.34
16.27
4
7.78
9.49
13.28
18.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.
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.84Comparison0.10 is much smaller than 3.84accept the null hypothesis — no significant associationWhat it means biologicallythe distributions of the two species are independent of each otherany apparent pattern in this woodland is likely to be down to chance
💡 Exam tip
Always draw the working table with the columns O, E, O − E, (O − E)2 and (O − E)2 ÷ E. It stops you losing track.
Write the null hypothesis, not the alternative one, unless the question asks for both.
Keep expected values to 2 decimal places and only round at the very end.
Quote both numbers when you conclude: your chi-squared value and the critical value.
If the result is significant, say which way — compare an observed value with its expected value to decide positive or negative.
Check the totals of your contingency table add up before you calculate anything else.
⚠ Common mix-up
The null hypothesis says there is NO association. Writing the opposite reverses your whole conclusion.
Larger chi-squared means reject the null, not accept it. This is the single most common slip.
Do not divide by the observed value. The equation divides by E every time.
Degrees of freedom is not the number of quadrats. It comes only from the size of the table.
Significant does not mean “large”. It means unlikely to be caused by chance.
The test shows association, not cause. Two species found together might share a soil preference rather than interact at all.
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.