Nonparametric & Rank-Based Methods

Agricultural Statistics & Data Science · Statistical theory core · also Non-parametric Statistics, Distribution-free Methods

11units
11chapters
5,446words
100practice questions

Methods that hold without a normal model: the empirical distribution, goodness-of-fit, sign and rank tests for one, two and many samples, rank correlation, and tests used for scored or ranked agricultural data such as disease ratings and sensory panels.

In the exams: AICE-JRF Ag Stat Unit 2 (heavy: run, sign, rank, Wilcoxon, Kruskal-Wallis, Mann-Whitney, Cochran, Friedman named); GATE ST 'Non-parametric Statistics' (heavy); UPSC ISS Statistics II (present)

Syllabus

  1. Empirical distribution function and its properties
  2. Goodness of fit: chi-square and Kolmogorov-Smirnov tests
  3. Run test for randomness
  4. Sign test and Wilcoxon signed-rank test
  5. Mann-Whitney U test and two-sample Kolmogorov-Smirnov test
  6. Kruskal-Wallis test
  7. Friedman's test for randomised blocks
  8. Cochran's Q test
  9. Spearman's and Kendall's rank correlations
  10. Asymptotic relative efficiency
  11. Analysing ordinal scores: disease ratings and sensory panels

Study manual

Nonparametric, or distribution-free, methods make inferences without assuming that the data follow a normal or other specified family. Most of them work with signs, ranks or counts rather than the raw values, so their null distributions are the same for every continuous population. They are the natural tools when samples are small and normality cannot be checked, when the data contain outliers, and when the measurements are themselves only ordinal: disease severity scores, damage grades, panel preferences, rankings of varieties by farmers.

Agriculture produces such data constantly. Plant pathologists score disease on 0-5 or 1-9 scales; entomologists grade damage; food scientists and breeders run sensory panels; participatory trials ask farmers to rank varieties; field records include censored and skewed quantities. Applying t-tests and ANOVA to such scores treats the gaps between categories as equal, which they are not. Rank methods avoid that assumption and, as the chapter on efficiency shows, lose surprisingly little power even when the data are normal.

The manual covers the empirical distribution function; goodness-of-fit tests (chi-square and Kolmogorov-Smirnov); the runs test for randomness; one-sample and paired methods (sign and Wilcoxon signed-rank tests); two-sample methods (Mann-Whitney and two-sample Kolmogorov-Smirnov); k-sample methods for completely randomised and randomised block layouts (Kruskal-Wallis and Friedman); Cochran's Q for binary responses in blocks; rank correlation (Spearman and Kendall); Pitman asymptotic relative efficiency; and the analysis of ordinal scores. It assumes the probability and inference background of the companion subjects (Probability Theory, Probability Distributions and Sampling Distributions, Statistical Inference I and II) and refers to them for the binomial, chi-square and normal distributions used as null or limiting laws.

Examinations name these tests explicitly. The ICAR AICE-JRF/SRF Agricultural Statistics paper lists run, sign, rank, Wilcoxon, Kruskal-Wallis, Mann-Whitney, Cochran and Friedman tests in Unit 2. GATE Statistics has a non-parametric section asking for test statistics, exact null probabilities and expectations. The Indian Statistical Service and state statistical services ask for applications and derivations of null means and variances.

1. The empirical distribution function

Definition and finite-sample properties

For a random sample X₁, ..., Xₙ from a distribution with CDF F, the empirical distribution function (EDF) is Fₙ(x) = (1/n) × (number of Xᵢ ≤ x). It is a step function rising by 1/n at each observation (by k/n at a value observed k times), from 0 below the smallest observation to 1 at and above the largest. It is the CDF of the distribution that puts mass 1/n on each data point, and every plug-in estimator, such as the sample mean, sample quantiles or the bootstrap, is a functional of it.

For each fixed x, nFₙ(x) counts how many of n independent trials fall at or below x, so nFₙ(x) is binomial(n, F(x)). Hence E[Fₙ(x)] = F(x), Fₙ(x) is unbiased for F(x), and Var[Fₙ(x)] = F(x)[1 − F(x)]/n, largest at the median. For x ≤ y, Cov[Fₙ(x), Fₙ(y)] = F(x)[1 − F(y)]/n. These results need no assumption about F, which is what makes the EDF the foundation of distribution-free inference. A pointwise large-sample interval for F(x) is Fₙ(x) ± z√(Fₙ(x)[1 − Fₙ(x)]/n), and exact binomial intervals can be used in small samples.

Uniform convergence and confidence bands

By the strong law of large numbers Fₙ(x) → F(x) almost surely for each x, and the Glivenko-Cantelli theorem strengthens this to uniform convergence: sup over x of |Fₙ(x) − F(x)| → 0 almost surely (see Probability Theory). The Dvoretzky-Kiefer-Wolfowitz inequality, with Massart's constant, quantifies the rate for every n: P(sup|Fₙ − F| > ε) ≤ 2exp(−2nε²). Setting the right-hand side equal to α gives a distribution-free 1 − α confidence band Fₙ(x) ± ε with ε = √(log(2/α)/(2n)), truncated to [0, 1]. For n = 100 and α = 0.05, ε ≈ 0.136: the whole unknown CDF lies within ±0.136 of the EDF with probability at least 0.95.

The process √n[Fₙ(x) − F(x)] converges to a Brownian bridge composed with F, which is the source of the limiting distribution of the Kolmogorov-Smirnov statistic. Because F(X) is uniform when F is continuous, the distribution of sup|Fₙ − F| does not depend on F; this probability-integral-transform argument is the reason the KS test is distribution-free.

In agricultural practice the EDF is plotted to compare the distribution of yields under two managements, to read off the proportion of farms below a yield threshold, and to estimate exceedance probabilities of rainfall amounts directly from records. Quantile-quantile and probability plots compare an EDF with a fitted model visually.

Sample quantiles are read from the EDF as well, and they too have distribution-free properties. The number of observations below the population p-quantile is binomial(n, p), so order statistics give exact confidence intervals for any quantile, not only the median: the interval [X₍ᵣ₎, X₍ₛ₎] covers the p-quantile with probability Σ from j = r to s − 1 of C(n, j)pʲ(1 − p)ⁿ⁻ʲ. This is how a seed company can state, without assuming normality, a lower confidence limit for the 10th percentile of seedling vigour, or how a hydrologist bounds the 90th percentile of daily rainfall from a station record. Tolerance limits, which cover a stated proportion of the population with stated confidence, are built from the same binomial argument.

Remember

2. Goodness-of-fit tests

Pearson's chi-square test

Goodness-of-fit tests ask whether data are consistent with a hypothesised distribution F₀. Pearson's chi-square test groups the data into k classes with observed counts Oⱼ and expected counts Eⱼ = npⱼ under F₀, and uses X² = Σ(Oⱼ − Eⱼ)²/Eⱼ. Under H₀ it is approximately χ² with k − 1 degrees of freedom, or k − 1 − s when s parameters are estimated from the grouped data by maximum likelihood or minimum chi-square (the estimation subject explains why). Classes with small expected counts (below 5 is the usual rule; some texts allow a few classes down to 1) are pooled first.

The chi-square test applies to discrete and grouped data, such as segregation ratios in genetics, counts of insects per plant fitted by Poisson or negative binomial models, or frequencies of disease grades. Its weaknesses are the arbitrariness of the grouping, the loss of information from grouping continuous data, and insensitivity to the order of the classes: a systematic drift across ordered categories counts no more than a random pattern of deviations of the same size.

The Kolmogorov-Smirnov test

For continuous data and a completely specified F₀, the one-sample Kolmogorov-Smirnov (KS) statistic is Dₙ = sup over x of |Fₙ(x) − F₀(x)|, the largest vertical distance between the EDF and the hypothesised CDF. Since Fₙ is a step function, the supremum is found at the observations: Dₙ = max over i of max{i/n − F₀(x₍ᵢ₎), F₀(x₍ᵢ₎) − (i − 1)/n}. Its null distribution is the same for every continuous F₀ and is tabulated; for large n the 5% and 1% critical values are close to 1.36/√n and 1.63/√n. One-sided versions D⁺ and D⁻ test stochastic ordering.

Compared with chi-square, KS uses the ungrouped data, is exact in small samples and is usually more powerful for continuous distributions; but it is most sensitive near the centre of the distribution and less so in the tails, where the Anderson-Darling statistic, which weights squared deviations by 1/[F₀(1 − F₀)], does better. The Cramér-von Mises statistic integrates squared deviations.

A crucial caveat: the KS tables assume F₀ is fully specified. If the mean and variance are estimated from the same data (testing normality, say), the test is far too conservative; Lilliefors tabulated corrected critical values for that case, and for normality the Shapiro-Wilk test is generally more powerful. KS is also not exactly distribution-free for discrete F₀, where it is conservative.

Choosing a goodness-of-fit method

In practice: use chi-square for counts and categories; KS or Anderson-Darling for a fully specified continuous model; Shapiro-Wilk or a normal probability plot to check residual normality before ANOVA; and graphical checks (Q-Q plots, EDF overlays) always, because a large sample makes trivial departures significant and a small sample hides important ones. A worked case: twenty wet-day rainfall amounts are tested against an exponential distribution with mean 10 mm fixed in advance. If the largest gap between the EDF and 1 − exp(−x/10) is 0.21, it is below the 5% critical value for n = 20 (0.294), so the fixed exponential model is not rejected; if the mean had been estimated from these same data, the standard table would not apply.

A second check worth knowing is the chi-square index-of-dispersion test for Poisson counts, which is a goodness-of-fit test aimed at one particular alternative: (n − 1)s²/x̄ is approximately χ²ₙ₋₁ when counts are Poisson. Because it targets over-dispersion, it is usually more powerful than a general chi-square fit for detecting clumped insect or weed counts, and it is the natural first test before fitting a negative binomial model. Goodness-of-fit tests answer 'is this model contradicted by the data?', never 'is this model true?'; a non-significant result with a small sample is weak support for the model.

Remember

3. The runs test for randomness

Runs in a sequence of two symbols

A run is a maximal sequence of identical symbols. In a sequence of n₁ symbols of one kind and n₂ of the other, the number of runs R measures how well mixed they are. Too few runs indicate clustering (positive serial dependence, trend or patchiness); too many indicate alternation (negative dependence or a regular pattern). Under the hypothesis that all arrangements are equally likely (randomness), the distribution of R depends only on n₁ and n₂.

With N = n₁ + n₂, E(R) = 2n₁n₂/N + 1 and Var(R) = 2n₁n₂(2n₁n₂ − N)/[N²(N − 1)]. For small samples exact tables are used; for n₁ and n₂ above about 10 to 20 the statistic Z = (R − E(R))/√Var(R) is approximately standard normal. Example: along a row of 20 plants, 10 diseased (D) and 10 healthy (H) occur in 6 runs. Then E(R) = 2 × 10 × 10/20 + 1 = 11 and Var(R) = 2 × 100 × 180/(400 × 19) = 4.737, so Z = (6 − 11)/2.176 = −2.30: significantly fewer runs than expected, pointing to clustering of disease along the row, as when a soil-borne pathogen spreads from plant to plant.

Uses and variants

For a numerical series, randomness can be tested with runs above and below the median (each observation coded + or − relative to the sample median), which detects trends and cycles in, for example, residuals ordered by time or by plot position in a field. Runs up and down count runs of increases and decreases between successive values and are more sensitive to oscillation. Wald and Wolfowitz's two-sample runs test pools two samples, orders them and counts runs of sample labels; few runs suggest the distributions differ in some way, but the test has low power against location shifts compared with Mann-Whitney.

The runs test checks one assumption that most other tests take for granted: independence. Field data ordered in space (adjacent plots) or time (successive harvests) are often serially correlated, and a significant runs test on residuals warns that standard errors from an ANOVA are unreliable and that a spatial or time-series model, or blocking, is needed. Its limitations are low power and the need for a meaningful ordering of the data.

Remember

4. Sign test and Wilcoxon signed-rank test

The sign test

The sign test is the simplest one-sample and paired test. To test H₀: median = m₀ for a continuous population, count S, the number of observations above m₀ (observations equal to m₀ are dropped and n reduced). Under H₀ each observation is above m₀ with probability 1/2, independently, so S ~ binomial(n, 1/2): exact p-values come from the binomial, and for larger n, Z = (S − n/2)/(√n/2), with a continuity correction, is approximately standard normal. For paired data, apply it to the differences: S counts pairs in which the treatment exceeds the control.

The sign test assumes only independence and a continuous distribution: not symmetry, not equal variances, not normality. It works with data recorded only as better or worse, which makes it useful for farmer-preference comparisons. Example: in 12 on-farm comparisons a new variety out-yields the local one on 10 farms. P(S ≥ 10 | n = 12, p = 1/2) = (66 + 12 + 1)/4096 = 0.0193, one-sided. The test inverts to a distribution-free confidence interval for the median using order statistics: [X₍ₖ₎, X₍ₙ₋ₖ₊₁₎], with k from the binomial.

The Wilcoxon signed-rank test

The Wilcoxon signed-rank test uses the magnitudes as well as the signs, at the cost of assuming that the distribution of the differences is symmetric about its median. Rank the absolute differences |dᵢ| from 1 to n (dropping zeros, giving tied values the average of their ranks), and let T⁺ be the sum of the ranks belonging to positive differences. Under H₀ (symmetry about 0) each rank is equally likely to carry either sign, so T⁺ has mean n(n + 1)/4 and variance n(n + 1)(2n + 1)/24, and its exact distribution is found by enumerating the 2ⁿ sign patterns. For n = 5, T⁺ = 15 (all positive) has probability 1/32 = 0.031.

For larger n, Z = [T⁺ − n(n + 1)/4]/√(n(n + 1)(2n + 1)/24) is approximately standard normal; with ties the variance is reduced by Σ(t³ − t)/48 over groups of t tied values. Example: with n = 20 pairs, E(T⁺) = 105 and Var(T⁺) = 717.5; an observed T⁺ = 160 gives Z = 55/26.79 = 2.05, significant at 5% two-sided.

The associated estimator of the centre of symmetry is the Hodges-Lehmann estimator: the median of the n(n + 1)/2 Walsh averages (dᵢ + dⱼ)/2, i ≤ j. It is robust to outliers and, under normality, nearly as efficient as the mean. When symmetry is doubtful (strongly skewed differences, such as percentage changes), the sign test is the safer choice; when the differences are roughly symmetric, the signed-rank test is far more powerful.

Remember

5. Mann-Whitney U and two-sample Kolmogorov-Smirnov tests

The Wilcoxon rank-sum / Mann-Whitney test

To compare two independent samples of sizes n₁ and n₂ (N = n₁ + n₂), rank all N observations together and let W₁ be the sum of the ranks of sample 1. The Mann-Whitney statistic U₁ = W₁ − n₁(n₁ + 1)/2 counts the number of pairs (X from sample 1, Y from sample 2) with X > Y (ties counted as 1/2). U₁ + U₂ = n₁n₂, so either statistic may be used. Under H₀ that the two samples come from the same continuous distribution, E(U) = n₁n₂/2 and Var(U) = n₁n₂(N + 1)/12, with a tie correction; exact tables are used for small samples and the normal approximation otherwise.

U/(n₁n₂) estimates P(X > Y), the probability that a randomly chosen unit from sample 1 exceeds one from sample 2, an interpretable effect size. Under a pure location-shift model the test is a test for a difference in medians, and the Hodges-Lehmann estimate of the shift is the median of the n₁n₂ differences Xᵢ − Yⱼ, with a distribution-free confidence interval from ordered differences. Without the shift assumption, the test detects stochastic ordering, not specifically a difference of medians: two distributions with equal medians but different shapes can give a significant result.

Example: disease scores on 6 treated and 6 untreated plants, with the treated plants occupying ranks 1, 2, 3, 5, 6 and 8 among the 12. W₁ = 25, U₁ = 25 − 21 = 4, while E(U) = 18 and Var(U) = 36 × 13/12 = 39, so Z = (4 − 18)/6.245 = −2.24 (before tie and continuity corrections): treated plants have significantly lower scores.

The two-sample Kolmogorov-Smirnov test

The two-sample KS statistic D = sup over x of |F₁(x) − F₂(x)|, the largest gap between the two EDFs, tests whether the two samples come from the same continuous distribution against any difference, in location, spread or shape. Its null distribution is distribution-free and tabulated; for large samples the 5% critical value is approximately 1.36√(N/(n₁n₂)). It is less powerful than Mann-Whitney against pure location shifts but detects differences that Mann-Whitney misses, such as two varieties with similar median yields but different stability (spread). The two-sample Cramér-von Mises and Anderson-Darling tests are alternatives with more weight on the tails.

Choosing among two-sample methods: the two-sample t-test when the data are roughly normal; Mann-Whitney for ordinal data, outliers or skewness, when interest is in which group tends to be larger; KS when any difference in distribution matters; and permutation tests when the exact null distribution of a chosen statistic (for example the difference in means) is wanted without normality.

Permutation (randomisation) tests deserve their own mention because they underlie all rank tests. Under H₀ that treatment labels are exchangeable, every reassignment of the observed values to the groups is equally likely; the p-value is the proportion of reassignments giving a statistic at least as extreme as the observed one. With 4 plots per treatment there are C(8, 4) = 70 reassignments, so the smallest one-sided p-value is 1/70 ≈ 0.014. Rank tests are permutation tests applied to ranks, which is why their null distributions can be tabulated once for all data sets. Fisher argued that the physical act of randomisation in a field trial justifies such tests without any distributional model, a point that links nonparametric inference directly to the design of experiments.

Remember

6. The Kruskal-Wallis test

Statistic and null distribution

The Kruskal-Wallis test extends Mann-Whitney to k independent samples, the rank analogue of one-way ANOVA for a completely randomised design. Rank all N observations together; let Rᵢ be the sum of ranks in group i with nᵢ observations. The statistic is H = [12/(N(N + 1))] Σ Rᵢ²/nᵢ − 3(N + 1). Under H₀ (all k samples from the same continuous distribution), H is approximately χ² with k − 1 degrees of freedom when the groups are not too small (about five or more each); exact tables exist for small samples. With ties, H is divided by 1 − Σ(t³ − t)/(N³ − N), summed over groups of t tied values; ties are common with scores, so the correction matters.

H is, apart from a constant, the between-groups sum of squares of the ranks: it equals (N − 1) times the ratio of the between-group to the total sum of squares of ranks. For k = 2 it reduces to the square of the Mann-Whitney Z statistic.

Example: three fungicides are applied to 5 plots each and the percentage of infected leaves recorded; the rank sums are 20, 40 and 60 (N = 15). H = [12/(15 × 16)] × (400 + 1600 + 3600)/5 − 3 × 16 = 0.05 × 1120 − 48 = 8.0, which exceeds χ²₂,₀.₀₅ = 5.991: the fungicides differ.

Follow-up comparisons and assumptions

A significant H says that at least one group tends to give larger values than another. Pairwise follow-up uses Dunn's procedure, which compares mean ranks with standard errors from the pooled ranking and adjusts for multiplicity (Bonferroni or Holm), or pairwise Mann-Whitney tests with adjustment. When the treatments have a natural order (increasing doses of a nutrient), the Jonckheere-Terpstra test for ordered alternatives is more powerful than Kruskal-Wallis.

The test assumes independent observations within and between groups and, for interpretation as a test of location, similar shapes across groups. Under normality its asymptotic efficiency relative to the F-test is 3/π ≈ 0.955, so little is lost by using it routinely for doubtful data; with heavy tails or outliers it can be much more powerful than F. It does not handle blocks: for randomised block designs Friedman's test (next chapter) is the rank method, and for more complex designs aligned-rank or rank-transform analyses and ordinal regression models are used.

Remember

7. Friedman's test for randomised blocks

Statistic and null distribution

Friedman's test is the rank analogue of two-way ANOVA for a randomised complete block design with one observation per treatment in each block. Within each of the b blocks, rank the k treatments from 1 to k; let Rⱼ be the sum over blocks of the ranks of treatment j. The statistic is χ²_F = [12/(bk(k + 1))] Σ Rⱼ² − 3b(k + 1), approximately χ² with k − 1 degrees of freedom under H₀ (no treatment differences) when b is moderate; exact tables cover small b and k. Ties within a block receive mid-ranks and a correction is applied.

Because ranking is done within blocks, block effects of any size and form are removed without assumptions about additivity. This makes Friedman's test suitable when blocks differ in scale, as when fields of very different fertility each test all varieties, or when each block is a judge who uses the rating scale in a personal way. Example: four varieties are ranked within each of 6 blocks, with rank sums 8, 14, 17 and 21. χ²_F = [12/(6 × 4 × 5)] × (64 + 196 + 289 + 441) − 3 × 6 × 5 = 0.1 × 990 − 90 = 9.0, exceeding χ²₃,₀.₀₅ = 7.815.

Relations and extensions

For k = 2, Friedman's test reduces to the sign test on the paired differences. Kendall's coefficient of concordance W = χ²_F/[b(k − 1)] lies between 0 and 1 and measures agreement among the b blocks (or judges) in ranking the k items: W = 1 when all rank identically, 0 when the rank sums are all equal. In the example, W = 9/(6 × 3) = 0.5. W is the standard summary of agreement in sensory panels and in participatory variety ranking.

Under normality, Friedman's asymptotic efficiency relative to the RCBD F-test is 0.955k/(k + 1): only 0.64 for k = 2 (the sign test's 2/π) but 0.86 for k = 8. Its power is therefore modest when there are few treatments; with many treatments and few blocks the Quade test, which weights blocks by their range, or an aligned-rank test may do better. Page's test is the ordered-alternative version for treatments with a natural order. Multiple comparisons after a significant Friedman test compare rank sums with a critical difference from the normal or studentized-range approximation, with multiplicity control. Friedman's test does not use differences in magnitude between blocks or within them beyond their order, so a strong but consistent ranking can be significant while small, inconsistent differences are not.

Remember

8. Cochran's Q test

Binary responses in blocks

Cochran's Q test compares k treatments when the response is binary (success/failure, infested/clean, accepted/rejected) and each block receives every treatment: the binary counterpart of Friedman's test. Arrange the data in a b × k table of 0s and 1s; let Cⱼ be the column (treatment) totals, Rᵢ the row (block) totals and N = ΣCⱼ = ΣRᵢ the grand total of successes. Then Q = (k − 1)[kΣCⱼ² − N²]/[kN − ΣRᵢ²], approximately χ² with k − 1 degrees of freedom under H₀ that the probability of success is the same for all treatments (within blocks). Rows that are all 0 or all 1 contribute nothing to the test and can be dropped.

Example: each of 4 farmers tries 3 seed treatments and records whether germination was satisfactory; column totals are 4, 2 and 0 and row totals 2, 2, 1, 1 (N = 6). Q = 2 × [3 × (16 + 4 + 0) − 36]/[3 × 6 − (4 + 4 + 1 + 1)] = 2 × 24/8 = 6.0, which exceeds χ²₂,₀.₀₅ = 5.991.

Relation to McNemar's test and limitations

For k = 2, Cochran's Q reduces to McNemar's test for paired proportions: with b₁₀ and b₀₁ the numbers of discordant pairs, McNemar's χ² = (b₁₀ − b₀₁)²/(b₁₀ + b₀₁), with 1 df. Only discordant pairs carry information about a difference; concordant pairs (both successes or both failures) do not. McNemar's test is used for before-and-after binary outcomes on the same farms or animals, such as adoption of a practice before and after training.

The chi-square approximation to Q needs a reasonable number of informative blocks; with few, exact permutation distributions should be used. Q tests equality of marginal success proportions and says nothing about which treatments differ: pairwise McNemar tests with multiplicity adjustment follow. For binary data with covariates or random block effects, logistic mixed models are the model-based alternative, and generalised estimating equations give population-average comparisons.

Agricultural uses of Cochran's Q include comparing several pest-detection methods (traps, visual counts, sweep nets) applied to the same fields, where the response is detected or not; several diagnostic kits applied to the same plant samples; and several extension messages each judged acceptable or not by the same farmers. In each case the blocks (fields, samples, farmers) differ greatly in their overall tendency to give a positive response, and Cochran's Q compares the methods while letting that tendency vary freely.

Remember

9. Rank correlation

Spearman's rank correlation

Spearman's rank correlation coefficient ρ_s is Pearson's correlation computed on the ranks. Without ties it simplifies to ρ_s = 1 − 6Σdᵢ²/[n(n² − 1)], where dᵢ is the difference between the ranks of the i-th unit on the two variables. It lies between −1 and 1, equals ±1 for any perfectly monotone (not necessarily linear) relation, and is unchanged by any increasing transformation of either variable. Under independence, E(ρ_s) = 0 and Var(ρ_s) = 1/(n − 1); exact tables are used for small n, and t = ρ_s√(n − 2)/√(1 − ρ_s²) or Z = ρ_s√(n − 1) is used for larger n. With ties, the mid-rank Pearson formula should be used rather than the shortcut.

Example: two judges rank 6 varieties for taste; the rank differences are 1, −1, 0, 2, −1, −1, so Σd² = 8 and ρ_s = 1 − 48/(6 × 35) = 0.771. With only six varieties the exact null distribution is needed: the one-sided 5% critical value of ρ_s for n = 6 is 0.829 in standard tables, so even this fairly high agreement is not significant, a reminder that rank correlations from small panels are imprecise.

Spearman's coefficient is also the basis of simple trend tests: correlating a series with time order (the Daniels test) checks for a monotone trend in, say, annual yields or pest catches without assuming linearity or normality, and the Mann-Kendall test does the same with Kendall's tau, which is widely used for trends in rainfall and temperature records in agro-climatology. Serial correlation in such series inflates the apparent significance, so pre-whitening or block bootstrap corrections are applied in climate work.

Kendall's tau

Kendall's τ compares all n(n − 1)/2 pairs of units: a pair is concordant if the unit higher on one variable is also higher on the other, discordant otherwise. With C concordant and D discordant pairs and no ties, τ = (C − D)/[n(n − 1)/2]. It is the difference between the probabilities of concordance and discordance, a directly interpretable quantity. Under independence E(τ) = 0 and Var(τ) = 2(2n + 5)/[9n(n − 1)]; the normal approximation is good from n of about 10. With ties, τ_b adjusts the denominator.

Spearman's ρ_s and Kendall's τ usually lead to the same conclusions, though |τ| is generally smaller than |ρ_s|. For a bivariate normal population with correlation ρ, τ = (2/π)arcsin ρ and the population value of ρ_s is (6/π)arcsin(ρ/2). Kendall's τ has the more tractable sampling theory and extends to partial rank correlation; Spearman's is easier to compute by hand. Under bivariate normality the asymptotic efficiency of both tests of independence relative to the test based on Pearson's r is 9/π² ≈ 0.912.

Uses in agriculture: agreement between two scorers of disease or quality, consistency of variety rankings across two environments (a rank-based look at genotype-by-environment interaction), association between farmers' preference ranks and measured yield, and monotone but non-linear dose-response trends.

Two cautions apply. A rank correlation near zero does not show independence when the relation is non-monotone (a U-shaped response to sowing date, for example). And with heavy ties, as when both variables are coarse scores, the effective information is reduced; tau-b or a polychoric correlation, which assumes underlying continuous variables, may be more appropriate. Partial rank correlation, which removes the effect of a third variable, is available for Kendall's tau but has a less tidy sampling theory than its Pearson counterpart.

Remember

10. Asymptotic relative efficiency

Pitman efficiency

How much power is lost by using ranks instead of the raw data? The Pitman asymptotic relative efficiency (ARE) of test A relative to test B is the limiting ratio n_B/n_A of the sample sizes needed for the two tests to reach the same power at the same level, against a sequence of alternatives approaching the null value. An ARE of 0.955 means that test A needs about 100/0.955 ≈ 105 observations to match test B with 100. For tests based on asymptotically normal statistics, the ARE equals the ratio of their squared efficacies, which can be computed from the null mean derivative and variance of each statistic.

Classical values for location problems (one-sample or paired, and two-sample shift): the sign test relative to the t-test has ARE 2/π ≈ 0.637 under the normal, 2 under the Laplace (double exponential) and 1/3 under the uniform. The Wilcoxon signed-rank and Mann-Whitney tests relative to the t-test have ARE 3/π ≈ 0.955 under the normal, 1 under the uniform and 1.5 under the Laplace. Hodges and Lehmann proved that the ARE of the Wilcoxon tests relative to the t-test is never below 108/125 = 0.864 for any continuous symmetric distribution, while it can be arbitrarily large (infinite) for heavy-tailed distributions. The sign test relative to the Wilcoxon signed-rank test has ARE 2/3 under the normal.

What the numbers mean in practice

Three conclusions follow. First, rank tests lose little when the data are normal (about 5%) and can gain a great deal when they are not, so the Wilcoxon and Mann-Whitney tests are sensible defaults for small, doubtful samples. Second, the sign test is the most robust but the least efficient for symmetric light-tailed data; it is the right choice when only signs are meaningful or symmetry fails badly. Third, efficiencies for k-sample rank tests mirror the two-sample ones: Kruskal-Wallis relative to the one-way F-test is 3/π under normality, and Friedman relative to the RCBD F-test is 0.955k/(k + 1).

Pitman efficiency is a large-sample, local-alternative concept. In small samples the discreteness of rank statistics, the achievable significance levels and the power at the actual effect size matter, and simulation is the practical check. Other efficiency concepts (Bahadur, Hodges-Lehmann efficiency for estimators) give different rankings for distant alternatives. The ARE of the Hodges-Lehmann location estimator relative to the sample mean equals that of the Wilcoxon test relative to the t-test, linking estimation and testing efficiency.

Remember

11. Analysing ordinal scores: disease ratings and sensory panels

Why scores need care

Many agricultural responses are ordinal: disease severity on a 0-5 or 1-9 scale, insect damage grades, lodging scores, vigour ratings, colour or taste preferences, and Likert-type responses in farmer surveys. The categories are ordered, but the distance between successive categories is unknown and generally unequal. Some disease scales, such as the Horsfall-Barratt scale, are deliberately built on logarithmic intervals of percentage severity, so a step from grade 2 to 3 does not correspond to the same change in diseased area as a step from 6 to 7.

Averaging the codes and applying t-tests or ANOVA assumes equal spacing; it may give reasonable answers when there are many categories and the scores are roughly symmetric, but it can mislead with few categories, floor or ceiling effects, or skewed distributions. Converting grades to class-midpoint percentages before averaging is a common compromise for severity scales; analysing the scores with methods that use only their order is the safer route.

Rank and model-based methods

Rank methods match the design. For two independent groups, the Mann-Whitney test, with its effect size P(X > Y), is the standard choice; for k groups in a completely randomised design, Kruskal-Wallis; for randomised blocks or for panels in which each judge scores every sample, Friedman, with Kendall's W summarising agreement between judges; for paired before-and-after scores, the sign or signed-rank test; and for agreement between two raters, weighted kappa or rank correlation. Ties are everywhere with scores, so mid-ranks and tie corrections are essential, and exact or permutation p-values are preferable when there are many ties and few observations.

Model-based alternatives treat the score as an ordinal response. The proportional-odds (cumulative logit) model writes log[P(Y ≤ j)/P(Y > j)] = θⱼ − x′β for each category boundary j, with one set of treatment effects β shared across boundaries; it handles covariates, blocks (as fixed or random effects) and unbalanced data, and its effects are interpretable as odds ratios. The Mann-Whitney statistic is closely related to the score test in this model. Checking the proportional-odds assumption, and using partial proportional odds or a cumulative probit model when it fails, are part of the analysis.

Sensory evaluation adds its own designs: ranking tests analysed by Friedman's test, paired-comparison and triangle tests analysed with binomial probabilities, and hedonic scales often analysed by ANOVA despite their ordinal nature; ISO and national standards specify such procedures and differ in details. For disease epidemics measured repeatedly, summarising each plot's ratings by the area under the disease progress curve (AUDPC) gives a quantitative response for which ANOVA is more defensible.

A worked recommendation for a typical case: a fungicide trial in randomised blocks with disease scored 0-9 per plot. Use Friedman's test (or a cumulative logit mixed model with block as a random effect) to compare treatments, report median scores and P(X > Y) or odds ratios as effect sizes, and avoid reporting means of codes with standard errors that imply interval-scale precision.

Remember

What the exams ask

How it is used, across a career

As a student

A student needs to recognise which rank test fits a design (paired, two independent groups, k groups, blocks, binary in blocks), compute its statistic by hand, know its null mean and variance and the chi-square or normal approximation, and know the exact small-sample distributions of the sign and signed-rank statistics. AICE-JRF names each test, and GATE ST asks numerical items on them. A thesis with disease scores, damage grades or panel ratings needs these methods instead of means of codes.

Five years in

A statistician five years into work at a research station analyses ordinal and skewed data every season: Friedman tests or cumulative logit mixed models for disease scores in blocked fungicide trials, Mann-Whitney comparisons of damage grades with P(X > Y) effect sizes, Kendall's W for agreement in sensory panels and participatory variety rankings, runs tests on residuals ordered across the field, and KS or Shapiro-Wilk checks before ANOVA. Explaining to pathologists why a mean of 0-9 scores with a standard error is misleading is part of the job.

Twenty-five years in

A senior statistician with twenty-five years of experience sets standards for scoring and analysis across programmes: which disease and damage scales are used, how scores are converted or analysed, which rank or ordinal-model methods are standard for variety evaluation and pesticide efficacy reports, and how sensory and farmer-preference studies are designed and summarised. Such a statistician reviews claims built on scored data and ensures that methods match the measurement scale and the design.

PhD, twenty-five years in

A PhD with long experience develops and studies rank-based and ordinal methods: efficiency of rank tests under spatial dependence in field trials, rank-based analyses for complex designs (aligned ranks, rank transforms, nonparametric mixed models), ordinal regression with random effects for multi-environment scored traits, and permutation methods for genomic association with ordinal phenotypes. Such a researcher proves asymptotic properties, checks small-sample behaviour by simulation, and teaches the theory.

Written from

Exact null-distribution tables and full derivations of asymptotic efficiencies are not reproduced. Not covered in depth: nonparametric regression and smoothing, density estimation, bootstrap methods, rank-based analyses for complex designs (aligned ranks, rank transforms), circular and multivariate rank tests, and survival-analysis rank tests such as the log-rank test. Sensory-test procedures follow ISO and national standards that differ in details and are not quoted. Rules of thumb for when normal or chi-square approximations are adequate differ between texts; the manual gives typical values. Questions state the critical values they need.

Original practice questions written to the syllabus and pattern of the exams named in each question's examTags. They are not past papers and do not reproduce any board's questions. Every numerical answer was computed with a script; the values needed are stated in the question.

Practise it, and prove it

These notes are free to read here, with no account.

What the Laisha app adds:

Free for ten days, then a subscription. We would rather write that here than have you find it later.

Open Laisha →