ADescribe · Guide test 098
Siegel–Tukey test
Compares dispersion through ranks assigned inward from both extremes of the pooled sample.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Equal spread tests — Do two or more groups have the same spread?
In Equal spread tests, choose Test = Siegel–Tukey.
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 · Siegel–Tukey test
Alternative
Your data
Drag a point or use ↑/↓ to change itIf H₀ were true
- The reference: how W varies across samples when H₀ is true.
- Your statistic, from the data above.
- The p-value: the total probability of outcomes no more likely than yours (p = .080).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- ranks assigned 1 to the smallest, 2–3 to the two largest, 4–5 to the next smallest …
The verdict
W = 87, p = .080
p > α = .050: compatible with H₀
A Wilcoxon rank-sum test on ranks that reward extremeness, so a small sum means more spread. Exact for small untied samples.
- Statistic
- 87.000
- p-value
- 0.0804
Siegel–Tukey test on Group 1: n = 10; Group 2: n = 12: W = 87, p = .080. The p-value is above α = .050, so the data are compatible with H₀.
Question and hypotheses
H0: the two population scales are equal.
Assumptions
Independent samples from distributions with a common location and comparable shape under a scale model; continuous observations for simple rank calibration. Location shifts can confound scale tests.
Formula
Parameters and notation
Assign scores inward from extremes: lowest gets 1, highest 2, next highest 3, next lowest 4, next lowest 5, continuing alternating paired ends. Average scores for ties.
Structure of the method
Assign ranks alternately from the outermost pooled observations inward using the Siegel–Tukey sequence, then compare the resulting score sum between groups. Untied data can use a Wilcoxon rank-sum distribution; tied data need the documented score and variance corrections.
Estimated and nuisance parameters
Estimated quantities are pooled ordered observations, Siegel–Tukey scores, and the group score sum. An optional median correction estimates group centers before scoring, changing the transformation. Group sample sizes determine the rank allocation distribution, not neural architecture or optimizer settings.
Settings and design choices
State alternative direction and whether median.corr is enabled; the supplied R example leaves it false. Document ties and the software’s exact-versus-normal switch. Because large scale produces many outermost values with low scores, interpretation must follow the package’s direction convention.
Fitting and adaptation
Recompute ordering and scores for each new dataset. If applying a median correction, any simulation intended to validate the complete procedure must redo that correction. There is no fine-tuning, and applying an ordinary rank-sum test directly to the raw observations instead tests a different contrast.
Sensitivity and robustness
Location differences confound the uncorrected scale comparison. Ties near the extremes can materially change scoring and approximation. The method needs comparable distributional shape for a clean scale interpretation; rejection does not establish which mechanism changed the spread of the measurements.
How to use and calibrate
Apply a rank sum test to the assigned Siegel–Tukey scores; specify centering convention.
Example application
Compare dispersion between two independent measurement processes.
Interpretation and pitfalls
Watch out
Do not interpret unequal locations as evidence of a scale difference. Estimated recentering changes finite sample calibration.
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.
Python and R
Scale interpretation requires a common location; an unmodeled location difference can affect rank scale tests.
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"""
x <- c(4.2,5.1,5.4,4.8,6.0,5.8,4.9,5.6,6.2,5.0)
y <- c(4.0,4.4,4.8,5.0,5.1,4.3,4.7,4.6,5.2,4.9)
print(PMCMRplus::siegelTukeyTest(x,y))
"""
# 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
x <- c(4.2,5.1,5.4,4.8,6.0,5.8,4.9,5.6,6.2,5.0)
y <- c(4.0,4.4,4.8,5.0,5.1,4.3,4.7,4.6,5.2,4.9)
print(PMCMRplus::siegelTukeyTest(x,y))
Sources
- PMCMRplus — PMCMRplus · siegelTukeyTestAuthor documentation/source reviewed: PMCMRplus 1.9.12.search.r-project.org
- siegelTukeyTestsearch.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 098, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT098.