ADescribe · Guide test 099
Klotz normal scores scale test
Tests scale differences using squared normal scores of pooled ranks.
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 = Klotz normal scores.
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 · Klotz normal scores scale test
Alternative
Your data
Drag a point or use ↑/↓ to change itIf H₀ were true
- The reference: how z varies across samples when H₀ is true (conditional normal approximation).
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .009).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- squared normal scores: large in both tails
The verdict
S = 8.41, z = −2.61, p = .009
p ≤ α = .050: reject H₀
The normal-scores version of a scale test: fully efficient when data are normal, still valid when they are not.
- Statistic
- −2.610
- p-value
- 0.0091
Klotz normal scores scale test on Group 1: n = 20; Group 2: n = 20: S = 8.41, z = −2.61, p = .009. The p-value is below α = .050, so the data are hard to reconcile 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
Ri are pooled ranks and Φ⁻¹ is the standard normal quantile; extreme ranks get large scores.
Structure of the method
Transform pooled ranks into standard-normal quantiles, square those quantiles, and compare their sums or means across groups. Large scores emphasize both distribution tails. The null reference comes from conditional rank allocation or an asymptotic score-statistic approximation with the chosen tie treatment.
Estimated and nuisance parameters
Empirical ranks, normal scores, and score variance are estimated. The normal quantile function defines scores rather than assuming the original measurements are Gaussian. Common location and a suitable scale-family structure are needed to interpret the group contrast specifically as scale.
Settings and design choices
Choose mid-ranks versus average scores for ties, alternative direction, conditional or asymptotic calibration, and any stratification. The two tie conventions differ because squaring a nonlinear score after averaging ranks is not generally the same as averaging the corresponding scores.
Fitting and adaptation
Re-pool ranks and regenerate scores after new data or category resolution changes. Conditional permutation should respect valid blocks, if used. Fine-tuning does not apply; searching several score families and reporting the smallest unadjusted p-value is a new selection procedure requiring control.
Sensitivity and robustness
Very extreme ranks and small samples can make score approximations sensitive. Coarse measurement ties, group location shifts, and unequal shapes complicate a scale conclusion. Compare central location and empirical distribution plots, and retain the package’s statistic orientation when interpreting one-sided results.
How to use and calibrate
Use the conditional permutation distribution or its standardized normal approximation.
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
Independent two-group score test of scale; uses the asymptotic conditional reference.
Not run — Executed end to end through Rscript · needs Python standard library + Rscript; R packages: coin
# 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)))
d<-droplevels(subset(d,group!="C"));print(coin::klotz_test(value~group,data=d,distribution="asymptotic"))
"""
# 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()
Validated — Executed successfully in the validation environment · needs coin
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)))
d<-droplevels(subset(d,group!="C"));print(coin::klotz_test(value~group,data=d,distribution="asymptotic"))
Output
Asymptotic Two-Sample Klotz Test data: value by group (A, B) Z = -0.099443, p-value = 0.9208 alternative hypothesis: true ratio of scales is not equal to 1
Sources
- coin — coin · klotz_testAuthor documentation/source reviewed: coin 1.4-6.search.r-project.org
- ScaleTestssearch.r-project.org
- klotz_testsearch.r-project.org
- Statistics guide v4 (historical):
- Python: Executed end to end through Rscript · R: Executed successfully in the validation 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 099, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT099.