IB Biology HLPopulations & CommunitiesPaper 1 & 2~14 min read
Chi–Squared Test
Two species keep turning up in the same quadrats. Is that a real association, or would you expect that much overlap by luck alone? The chi–squared test answers exactly that question, and it is entirely mechanical once you have the table drawn.
📘 What you need to know
Species distribution is rarely random — it depends on soil type, water availability, competition and more.
Species in a symbiotic relationship are likely found next to each other: a positive association.
Species in direct competition exclude each other, so are found in different parts of a habitat: a negative association.
Species with no interaction have distributions that are independent; any apparent pattern is due to chance.
The chi–squared test determines whether the difference between observed and expected results is due to chance or to an association.
The null hypothesis states there is no significant difference or association; the alternative hypothesis states there is one.
If the chi–squared value is larger than the critical value, the difference is significant and the null hypothesis is rejected.
What “association” means
That last point is why the test exists. Human eyes find patterns in random scatter, so a statistical test is needed to check whether the pattern is real.
The test itself
The chi–squared test determines whether there is a significant difference between the observed and expected results in an experiment. Its purpose is to assess whether the difference is due to chance or due to an association between the variables being tested.
If the result is not statistically significant, researchers conclude the species distributions are independent, and any appearance of association is due to chance.
If the association is statistically significant, it must be due to an important factor, such as a symbiotic relationship.
Hypothesis
What it states
Null hypothesis
There is no significant difference or association between data sets, e.g. no association between the distributions of two species
Alternative hypothesis
There is a significant difference or association, e.g. there is an association (positive or negative) between the distributions of two species
The chi–squared value
chi–squared = Σ [ ( O − E )² ÷ E ]
Where Σ means “the sum of”, O is the observed value, and E is the expected value — what you would expect to see if the null hypothesis were correct.
Expected values
E = ( row total × column total ) ÷ overall total
🧩 The eleven steps
Construct a contingency table, recording how many quadrats contain one, both, or neither species.
Calculate the row, column and overall totals.
Calculate the expected values for every cell.
Calculate the difference between observed and expected (O − E). Some will be negative.
Square each difference. This eliminates the negatives.
Divide each squared difference by its expected value.
Add the results together. This gives the chi–squared value.
Calculate the degrees of freedom.
Establish a probability level (p–value). Biologists use 0.05, or 5 %.
Use a critical values table with steps 8 and 9 to find the critical value.
Compare the chi–squared value with the critical value to assess significance.
Degrees of freedom
degrees of freedom = ( number of columns − 1 ) × ( number of rows − 1 )
Columns and rows here refer to the original contingency table, not the table with the totals added. A two–by–two table therefore gives (2 − 1) × (2 − 1) = 1 degree of freedom.
A probability level of 0.05 means you can be 95 % certain that any significant difference or association is not due to chance. Some studies need more certainty than this — medical researchers may use a smaller p–value.
Worked example: barnacles and limpets
WE 1
A full chi–squared test
A researcher placed 60 random quadrats on a rocky shore and recorded the presence or absence of barnacles and limpets in each. Both present: 24. Barnacles only: 9. Limpets only: 8. Neither: 19. Their null hypothesis was that there is no association between the distributions of the two species. Test for a statistically significant association. (6 marks)
Step 1 and 2: contingency table with totals
Barnacles present: 24 with limpets, 9 without, row total 33. Barnacles absent: 8 with limpets, 19 without, row total 27. Column totals: limpets present 32, limpets absent 28. Overall total 60.
Step 3: expected values
Both present: (33 × 32) ÷ 60 = 17.60. Barnacles only: (33 × 28) ÷ 60 = 15.40. Limpets only: (27 × 32) ÷ 60 = 14.40. Neither: (27 × 28) ÷ 60 = 12.60.
Steps 4 and 5: differences, then squared
Every difference here is 6.40 or −6.40, so every squared difference is 40.96.
Step 6: divide each by its own E
40.96 ÷ 17.60 = 2.33 | 40.96 ÷ 15.40 = 2.66 | 40.96 ÷ 14.40 = 2.84 | 40.96 ÷ 12.60 = 3.25
Step 7: add them up
2.33 + 2.66 + 2.84 + 3.25 = 11.08Step 8: degrees of freedom
(2 − 1) × (2 − 1) = 1
Steps 9 and 10: critical value
At p = 0.05 with 1 degree of freedom, the critical value is 3.84.
Step 11: compare
11.08 is larger than 3.84, so the difference is statistically significant and the null hypothesis is rejected. There is a significant association, and since both species occur together more often than expected, it is a positive association.
Chi–squared 11.08 > 3.84, so reject the null hypothesisfinish by saying which direction the association runs — positive or negative
Cell
O
E
O − E
(O − E)²
(O − E)² ÷ E
Both present
24
17.60
6.40
40.96
2.33
Barnacles only
9
15.40
−6.40
40.96
2.66
Limpets only
8
14.40
−6.40
40.96
2.84
Neither
19
12.60
6.40
40.96
3.25
Total
60
60.00
—
—
11.08
Always build that table before you touch the calculator. It keeps every value in its own column, and it means a slip in one cell does not silently poison the whole sum. Examiners award method marks for a clearly laid–out table even when the arithmetic wobbles.
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.64
10.83
2
4.60
5.99
9.21
13.82
3
6.25
7.82
11.34
16.27
4
7.78
9.49
13.28
18.46
At p = 0.05, a significant result means there is only a 5 % probability that the difference or association you found is down to chance.
🧠
Bigger means Bin it
If your chi–squared value is bigger than the critical value, bin the null hypothesis — reject it, because there is a significant association. Anything equal or smaller, and the null hypothesis stands.
More worked examples
WE 2
Interpreting a non–significant result
A student obtains a chi–squared value of 2.15 with 1 degree of freedom at p = 0.05. State and explain their conclusion. (3 marks)
Step 1: compare
The critical value at 1 degree of freedom and p = 0.05 is 3.84. The chi–squared value of 2.15 is smaller than this.
Step 2: the decision
There is no statistically significant association between the distributions of the two species, so the null hypothesis is accepted.
Step 3: what that means biologically
The distributions of the two species are independent of each other, and any apparent association is due to chance.
2.15 < 3.84, so accept the null hypothesis“accepted” not “proved” — statistics never proves a hypothesis true
WE 3
Predicting the type of association
Two plant species compete directly for the same soil nutrients. Predict what a chi–squared test on their distributions would show. (2 marks)
Point 1: the biology
Species in direct competition exclude each other from their immediate surroundings, so they are likely to be found in different parts of the habitat.
Point 2: the statistics
The number of quadrats containing both species would be lower than expected, giving a chi–squared value larger than the critical value, and the null hypothesis would be rejected in favour of a negative association.
A significant negative associationa large chi–squared value alone does not say positive or negative — look at where O exceeds E
💡 Exam tips
Always state the null hypothesis before you calculate anything.
Lay out a table with columns for O, E, O − E, (O − E)² and (O − E)² ÷ E.
Expected values come from row total × column total ÷ overall total.
Degrees of freedom use the original contingency table, without the totals row and column.
Compare against the critical value at p = 0.05 unless told otherwise.
Finish by saying reject or accept the null hypothesis, and say whether the association is positive or negative.
⚠ Common mistakes
Forgetting to divide by E. The formula is (O − E)² divided by E, cell by cell.
Dividing every cell by the same expected value. Each cell has its own E.
Including the totals row and column when counting rows and columns for degrees of freedom.
Getting the comparison backwards. Bigger than critical means reject the null.
Saying the test proves an association. It shows one is statistically significant.
Stopping at “significant”. Say whether the association is positive or negative.
That completes Populations & Communities. Look back at the shape of it: you learned what a population is, how to measure one, what stops it growing, what it does to its own members and to other species — and finally how to prove statistically that the patterns you found are real.
Want this explained one-to-one?
Book a free session with an experienced IB Biology tutor and get your trickiest topics made simple.