IB Biology HL Populations & Communities Paper 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

What “association” means

Three things a pair of species can do Each panel is the same habitat, sampled with quadrats POSITIVE NEGATIVE NO ASSOCIATIONfound together e.g. symbiosis found apart e.g. direct competition scattered independently no interactionThe test tells you which panel your data resembles To the eye, the third panel can easily look like the first.
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.

HypothesisWhat it states
Null hypothesisThere is no significant difference or association between data sets, e.g. no association between the distributions of two species
Alternative hypothesisThere 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

  1. Construct a contingency table, recording how many quadrats contain one, both, or neither species.
  2. Calculate the row, column and overall totals.
  3. Calculate the expected values for every cell.
  4. Calculate the difference between observed and expected (O − E). Some will be negative.
  5. Square each difference. This eliminates the negatives.
  6. Divide each squared difference by its expected value.
  7. Add the results together. This gives the chi–squared value.
  8. Calculate the degrees of freedom.
  9. Establish a probability level (p–value). Biologists use 0.05, or 5 %.
  10. Use a critical values table with steps 8 and 9 to find the critical value.
  11. 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.08 Step 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 hypothesis finish by saying which direction the association runs — positive or negative
CellOEO − E(O − E)²(O − E)² ÷ E
Both present2417.606.4040.962.33
Barnacles only915.40−6.4040.962.66
Limpets only814.40−6.4040.962.84
Neither1912.606.4040.963.25
Total6060.0011.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 freedomp = 0.1p = 0.05p = 0.01p = 0.001
12.713.846.6410.83
24.605.999.2113.82
36.257.8211.3416.27
47.789.4913.2818.46
The final comparison One number against one number, and you are done chi–squared vs critical value LARGER THAN CRITICAL significant association REJECT the null hypothesisEQUAL OR SMALLER no significant association ACCEPT the null hypothesisBigger than critical means reject the null
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 association a large chi–squared value alone does not say positive or negative — look at where O exceeds E

💡 Exam tips

⚠ Common mistakes

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.

Book a Free Session →