Statistical Tests: Chi-Squared t-Test and Spearman Rank
Why Use Statistical Tests?
In biology, we collect data from samples and need to determine whether observed patterns (differences or associations) are statistically significant or could have arisen by chance alone. Statistical tests allow us to make objective decisions by calculating the probability that our results occurred by chance.
Hypotheses
Every statistical test compares two hypotheses:
- Null hypothesis (H₀): There is no significant difference/association/correlation between the variables. Any observed difference is due to chance.
- Alternative hypothesis (H₁): There is a significant difference/association/correlation.
We test the null hypothesis. If the probability of the results occurring by chance is very low (typically p ≤ 0.05, i.e. less than 5%), we reject H₀ and accept H₁ — the result is statistically significant. If p > 0.05, we do not reject H₀ — the result is not significant.
Choosing the Right Test
| Test | Used when | Data type | What it tests |
|---|---|---|---|
| Chi-squared (χ²) | Comparing observed frequencies to expected frequencies | Categorical (count data in categories) | Whether there is a significant difference between observed and expected values |
| Student's t-test | Comparing the means of two groups | Continuous (interval/ratio), normally distributed | Whether there is a significant difference between two means |
| Spearman's rank correlation | Looking for an association between two variables | Ordinal or continuous (ranked data) | Whether there is a significant correlation (positive or negative) |
Chi-Squared Test (χ²)
When to Use
- Data are frequencies (counts) in categories
- You have expected values to compare against (e.g. from a genetic ratio, or from an equal distribution hypothesis)
- Data must be independent — each observation falls into one category only
- Expected values should all be ≥5 for the test to be valid
Common Applications in Biology
- Testing whether observed genetic ratios match expected Mendelian ratios (e.g. 3:1, 9:3:3:1)
- Testing whether organisms are randomly distributed (observed vs expected quadrat counts)
- Testing whether there is an association between two categorical variables
Formula
χ² = Σ [(O - E)² / E]
Where:
- O = observed frequency in each category
- E = expected frequency in each category
- Σ = sum across all categories
Worked Example
A cross between two heterozygous purple-flowered plants (Pp × Pp) is expected to give a 3:1 ratio of purple to white flowers. You observe 68 purple and 32 white (total = 100).
Expected values: Purple = 100 × 3/4 = 75; White = 100 × 1/4 = 25
| Category | O | E | O - E | (O - E)² | (O - E)²/E |
|---|---|---|---|---|---|
| Purple | 68 | 75 | -7 | 49 | 0.653 |
| White | 32 | 25 | 7 | 49 | 1.960 |
| Total | χ² = 2.613 |
Degrees of freedom (df) = number of categories - 1 = 2 - 1 = 1
Compare to critical value: At p = 0.05 with 1 df, the critical value is 3.84.
Since χ² = 2.613 < 3.84, we do not reject H₀. The difference between observed and expected ratios is not significant — the results are consistent with a 3:1 ratio.
Interpreting the Result
- If χ² ≥ critical value → reject H₀ → significant difference → observed data do NOT fit the expected ratio
- If χ² < critical value → do not reject H₀ → no significant difference → observed data are consistent with the expected ratio
Student's t-Test
When to Use
- Comparing the means of two independent groups (unpaired t-test) or two related measurements (paired t-test)
- Data are continuous (measured on an interval/ratio scale)
- Data are approximately normally distributed
- The two groups have similar variances (for the unpaired test)
Common Applications
- Comparing mean plant height in two different soil types
- Comparing mean heart rate before and after exercise
- Comparing mean species richness in two habitats
Formula (Unpaired t-Test)
t = (x̄₁ - x̄₂) / √(s₁²/n₁ + s₂²/n₂)
Where:
- x̄₁, x̄₂ = means of the two groups
- s₁², s₂² = variances of the two groups
- n₁, n₂ = sample sizes of the two groups
Degrees of freedom = n₁ + n₂ - 2
Worked Example
Mean leaf length of species A: x̄₁ = 42.3 mm, s₁² = 18.5, n₁ = 15
Mean leaf length of species B: x̄₂ = 38.1 mm, s₂² = 22.1, n₂ = 15
t = (42.3 - 38.1) / √(18.5/15 + 22.1/15)
t = 4.2 / √(1.233 + 1.473)
t = 4.2 / √2.707
t = 4.2 / 1.645
t = 2.553
df = 15 + 15 - 2 = 28
At p = 0.05 with 28 df, the critical value is approximately 2.048.
Since t = 2.553 > 2.048, we reject H₀. There is a significant difference in mean leaf length between the two species (p < 0.05).
Interpreting the Result
- If t ≥ critical value → reject H₀ → the means are significantly different
- If t < critical value → do not reject H₀ → no significant difference between means
Spearman's Rank Correlation Coefficient (rₛ)
When to Use
- Testing for a correlation (association) between two continuous or ordinal variables
- Data do NOT need to be normally distributed (this is a non-parametric test)
- You want to know if there is a monotonic relationship (as one variable increases, the other consistently increases or decreases — not necessarily linearly)
Common Applications
- Correlation between altitude and species diversity
- Correlation between pollution level and lichen abundance
- Correlation between age and reaction time
Formula
rₛ = 1 - [6ΣD² / n(n² - 1)]
Where:
- D = difference between the ranks of each pair of values
- n = number of pairs
- Σ = sum of all D² values
Steps
1. Rank each variable separately (1 = lowest value). If values are tied, assign the average rank (e.g. two values sharing ranks 3 and 4 both get rank 3.5)
2. Calculate D (difference between the two ranks) for each pair
3. Calculate D² for each pair
4. Sum all D² values (ΣD²)
5. Substitute into the formula
Worked Example
Testing correlation between distance from a river (m) and plant height (cm), with n = 8 data points.
After ranking and calculating: ΣD² = 12
rₛ = 1 - [6 × 12 / 8(64 - 1)]
rₛ = 1 - [72 / 504]
rₛ = 1 - 0.143
rₛ = 0.857
At p = 0.05 with n = 8, the critical value is 0.738.
Since rₛ = 0.857 > 0.738, we reject H₀. There is a significant positive correlation between distance from the river and plant height (p < 0.05).
Interpreting rₛ
| Value of rₛ | Interpretation |
|---|---|
| +1 | Perfect positive correlation |
| 0 to +1 | Positive correlation (strength increases toward +1) |
| 0 | No correlation |
| 0 to -1 | Negative correlation (strength increases toward -1) |
| -1 | Perfect negative correlation |
Important: Correlation does not imply causation. A significant correlation means the variables are associated, but other factors (confounding variables) may be responsible.
Standard Deviation and Standard Error
Standard deviation (SD) measures the spread of data around the mean:
- A small SD means data points are clustered close to the mean
- A large SD means data points are widely spread
- Approximately 68% of data falls within ±1 SD of the mean (for normally distributed data)
- Approximately 95% falls within ±2 SD
Standard error of the mean (SE) = SD / √n
- SE estimates the accuracy of the sample mean as an estimate of the true population mean
- Used to construct 95% confidence intervals (mean ± 1.96 × SE)
- If confidence intervals of two groups do not overlap, the difference is likely significant
Exam Tips
- AQA provides the formulas and critical value tables — you do NOT need to memorise them, but you must know when to use each test and how to interpret the result
- Always state H₀ clearly, show your working, compare your calculated value to the critical value, and state your conclusion in the context of the biology
- For chi-squared, remember that a SMALL χ² value means the observed data FIT the expected ratio (no significant difference) — this is counter-intuitive for students used to rejecting H₀
- When reporting Spearman's, always state the direction (positive/negative) and strength of the correlation
- Critical value tables require you to know the degrees of freedom (df) — for χ² this is categories - 1; for t-test this is n₁ + n₂ - 2; for Spearman's use n (number of pairs)
- Always include a statement about whether correlation implies causation (it does not)