Skip to content

BCompare groups · Guide test 026

Van der Waerden normal scores test

Transforms pooled ranks to normal scores to compare independent group locations.

Runs in CodeSplashPython (calls R) example not runR example not run Corrected in edition 2

Do it in CodeSplash

In the app, set it up in Analyze with this method:

  • Kruskal–Wallis test — Do three or more independent groups differ in location (without assuming normality)?

In Kruskal–Wallis test, choose Rank scores = Normal scores (van der Waerden).

Do it in CodeSplash Run this test on your own data, in Python or R.

Bench

Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.

Bench · Van der Waerden normal scores test

3
10
0.60

Group i has true mean (i − 1) × spread.

1.00
0.050

Your data

Drag a point or use ↑/↓ to change it
Group 1 · n = 10 · mean 0.16Group 2 · n = 10 · mean 0.90Group 3 · n = 10 · mean 0.97

If H₀ were true

T = 5.11
  1. The reference: how T varies across samples when H₀ is true.
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .078).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

T=(N−1)∑jnjAˉj2∑iAi2,Ai=Φ−1 ⁣(riN+1)T = \dfrac{(N-1)\sum_j n_j\bar A_j^2}{\sum_i A_i^2},\qquad A_i = \Phi^{-1}\!\left(\dfrac{r_i}{N+1}\right)

With your numbers

T=5.11,ν=2T = 5.11,\quad \nu = 2
AiA_i
normal score of the pooled rank
Aˉj\bar A_j
mean score in group j

The verdict

T(2) = 5.11, p = .078

p > α = .050: compatible with H₀

As efficient as ANOVA for normal data and still valid when it is not — often more powerful than Kruskal–Wallis for light tails.

Statistic
5.112
p-value
0.0776
Van der Waerden normal scores test on Group 1: n = 10; Group 2: n = 10; Group 3: n = 10: T(2) = 5.11, p = .078. The p-value is above α = .050, so the data are compatible with H0.

Van der Waerden normal scores test on Group 1: n = 10; Group 2: n = 10; Group 3: n = 10: T(2) = 5.11, p = .078. The p-value is above α = .050, so the data are compatible with H₀.

Question and hypotheses

H0: k groups have identical distributions; a location alternative is common.

Assumptions

Independent observations and independent groups; ordinal or quantitative measurements. The permutation null is identical group distributions. A location or median interpretation additionally needs comparable distribution shapes.

Formula

ai=Φ−1{Ri/(N+1)}T=∑jnjaˉj2(N−1)−1∑iai2\begin{gathered}a_i=\Phi^{-1}\{R_i/(N+1)\}\\[5pt] T=\frac{\sum_jn_j\bar a_j^2}{(N-1)^{-1}\sum_i a_i^2}\end{gathered}

Parameters and notation

Ri is a pooled rank and Φ⁻¹ a normal quantile; āj is its group mean. With ties center scores and use their empirical variance.

Structure of the method

Transform pooled ranks to inverse-normal scores, summarize their group means, and compare the between-group score quadratic form with a pooled score-variance scale. A chi-square approximation or label permutation provides calibration. With ties, score construction, centering, and variance must be defined explicitly; merely inserting midranks into every untied formula is insufficient.

Estimated and nuisance parameters

Estimate group average normal scores and the pooled empirical score variance when using a tie-aware implementation. The normal quantile map is a prespecified scoring rule, not an estimated normal distribution for the measurements. Group sizes and the null equality restriction determine the dimension of the omnibus comparison.

Settings and design choices

Specify alpha, scoring convention for tied positions, asymptotic or conditional calibration, and missing-data treatment. Extreme ranks receive stronger leverage under normal scores than under linear ranks. Choosing between normal, linear, and Savage scores after inspecting their p-values creates a multiple-analysis selection problem.

Fitting and adaptation

Recalculate the full pooled score map after changes in the data and re-estimate any empirical score variance. For a tied or highly discrete application, use a documented tie-aware permutation/scoring implementation rather than assuming the supplied convenience call performs all corrections mentioned in general theory.

Sensitivity and robustness

The current PMCMRplus vanWaerdenTest manual explicitly says no tie correction is applied. The baseline continuous random example is compatible with that limitation; a rounded survey application is not automatically so. Small samples can make chi-square approximation inaccurate, and transformed ranks do not test measurement normality.

How to use and calibrate

Compare T with χ²k−1 or permute labels. Normal scores favor smooth location shifts near normality.

Example application

Compare continuous responses across three independent groups while reducing dependence on the original measurement scale.

Interpretation and pitfalls

Watch out

This is a rank based omnibus test, not a normality test. Extreme ranks receive relatively strong weight.

What changed in edition 2

  • New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.
  • Rewritten in the review: interpretation and pitfalls.
  • Interpretation and pitfallssearch.r-project.org

    The official method manual explicitly documents absent tie correction.

    Corrected text

    This is a rank based omnibus test, not a normality test. Extreme ranks receive relatively strong weight. The cited PMCMRplus implementation does not apply a tie correction; use an explicitly tie-aware calculation or permutation method when tied outcomes are material.

Python and R

Ranks/scores use all observations pooled across independent groups; the omnibus p-value is not a pairwise conclusion.

Python · invokes R

Not run — Python launcher syntax checked; R backend runtime not verified · needs Python standard library + Rscript; R packages: PMCMRplus

# Python launcher for the complete R implementation below.
# Requires Rscript on PATH and the listed R packages.
import shutil
import subprocess
rscript = shutil.which("Rscript")
if rscript is None:
    raise RuntimeError("Install R and make Rscript available on PATH.")
r_code = r"""
set.seed(2026)
d <- data.frame(value=c(rnorm(20),rnorm(20,.4),rnorm(20,.8)), group=factor(rep(c("A","B","C"),each=20)))
print(PMCMRplus::vanWaerdenTest(value~group,data=d))
"""
# No shell interpolation. A failed R execution raises an error in Python.
result = subprocess.run([rscript, "--vanilla", "-"], input=r_code,
                        text=True, capture_output=True)
print(result.stdout)
if result.stderr:
    print(result.stderr)
result.check_returncode()
R

Not run — Syntax checked; runtime not verified in the final environment · needs PMCMRplus

set.seed(2026)
d <- data.frame(value=c(rnorm(20),rnorm(20,.4),rnorm(20,.8)), group=factor(rep(c("A","B","C"),each=20)))
print(PMCMRplus::vanWaerdenTest(value~group,data=d))

Sources

Statistics guide v4 (historical):
Python: Python launcher syntax checked; R backend runtime not verified · R: Syntax checked; runtime not verified in the final environment
Reference's record:
Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Python-to-R bridge; Rscript is unavailable. R code was not executed. Python: Not run in the reference's review: Python-to-R bridge; Rscript is unavailable. R code was not executed. R: Reviewed but not run: R wasn't available to the reference's authors.

From the CodeSplash statistics guide (v4), entry 026, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT026.