UNIHIVE

Study Hub UNIPORT STA 264

STA 264 · Statistics for Biological and Agricultural Sciences

Some non-parametric tests

Sign test, Wilcoxon, Mann-Whitney and Kruskal-Wallis for data that aren't normal.

Our notes

2 min read

When to use them

Non-parametric tests don't need normal data. Use them for:

  • ranks or scores (disease score 1 to 5)
  • small samples that are clearly skewed
  • data with outliers

They're less powerful than t tests when data really are normal.

Sign test: for pairs

Count which of each pair is bigger, and drop ties. Under H₀, plus and minus each have a probability of 1/2.

Example: weed score before and after a treatment on 8 plots. 7 fell, 1 rose.

P(7 or more of 8) = (⁸C₇ + ⁸C₈)/2⁸ = (8 + 1)/256 = 0.035. Two-tailed p = 0.07. This isn't significant at 5%, though it's near.

Wilcoxon signed-rank test: for pairs

This uses the size of the differences as well.

  1. Find the differences; drop zeros.
  2. Rank the absolute values; average any ties.
  3. Sum the ranks of the positive differences (W₊), and of the negative differences (W₋).
  4. Take the smaller, T, and compare it with the table. T at or below the table value is significant.

Example: differences: 3, 5, −1, 4, 6, 2 (n = 6).

Ranks of absolute values: 1→1, 2→2, 3→3, 4→4, 5→5, 6→6.

W₋ = 1; W₊ = 3 + 5 + 4 + 6 + 2 = 20; T = 1.

The table value at n = 6, 5% two-tailed is 0, so T = 1 is not significant.

Check: W₊ + W₋ = n(n + 1)/2 = 21. And 20 + 1 = 21. Correct.

Mann-Whitney U test: two independent groups

  1. Rank all values together.
  2. Sum the ranks of group 1, as R₁.
  3. U₁ = n₁n₂ + n₁(n₁ + 1)/2 − R₁, and U₂ = n₁n₂ − U₁.
  4. Take the smaller, and compare it with the table.

Example: disease scores. Treated: 1, 2, 2, 3. Untreated: 3, 4, 4, 5.

Sorted: 1, 2, 2, 3, 3, 4, 4, 5, with ranks 1, 2.5, 2.5, 4.5, 4.5, 6.5, 6.5, 8.

R₁ = 1 + 2.5 + 2.5 + 4.5 = 10.5.

U₁ = 16 + 10 − 10.5 = 15.5. U₂ = 0.5. The smaller is 0.5.

The table value at n₁ = n₂ = 4, 5% two-tailed is 0. So 0.5 is just not significant, with such a small sample.

Check: U₁ + U₂ = 16 = n₁n₂. Correct.

Kruskal-Wallis test: three or more groups

The non-parametric version of one-way ANOVA.

H = [12/(N(N + 1))] Σ(Rᵢ²/nᵢ) − 3(N + 1), compared with χ² with k − 1 df, for groups that aren't too small.

Example: three groups, n = 3 each, with no overlap: ranks 1, 2, 3; 4, 5, 6; 7, 8, 9.

Rank sums: 6, 15, 24.

H = [12/90](36/3 + 225/3 + 576/3) − 30 = (0.1333)(279) − 30 = 37.2 − 30 = 7.2.

Compared with χ²₂ at 5% (5.99), it's significant. (Exact tables are better for such small groups.)

Friedman test

The non-parametric form of the RCBD. Treatments are ranked within each block.

Choosing a test

DataParametricNon-parametric
Two paired samplesPaired tSign, Wilcoxon
Two independent samplesTwo-sample tMann-Whitney
3+ independent samplesOne-way ANOVAKruskal-Wallis
BlocksRCBD ANOVAFriedman
AssociationPearson's rSpearman's r_s

Reporting

Report the median and the interquartile range with these tests, rather than the mean and SD.

Exams usually ask: choose a suitable test and justify it; run a sign, Wilcoxon or Mann-Whitney test; handle ties; explain the trade-off in power.

Common mistake: forgetting to give tied values the average of their ranks. Two values sharing ranks 2 and 3 both get 2.5.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All STA 264 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.