BCompare groups · Guide test 026
Van der Waerden normal scores test
Transforms pooled ranks to normal scores to compare independent group locations.
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
Group i has true mean (i − 1) × spread.
Your data
Drag a point or use ↑/↓ to change itIf H₀ were true
- The reference: how T varies across samples when H₀ is true.
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .078).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- normal score of the pooled rank
- 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 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
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.
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()
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
- PMCMRplus — PMCMRplus · vanWaerdenTestAuthor documentation/source reviewed: PMCMRplus 1.9.12.search.r-project.org
- vanWaerdenTestsearch.r-project.org
- 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.