BCompare groups · Guide test 038
Skillings–Mack test
Extends Friedman type inference to incomplete blocks and missing observations in suitable designs.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Friedman test (repeated measures, ranks) — Do three or more conditions measured on the same subjects differ in location?
In Friedman test (repeated measures, ranks), choose Test = Skillings–Mack.
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 · Skillings–Mack test
Your data
Some subjects miss some conditions| Subject | C1 | C2 | C3 | C4 |
|---|---|---|---|---|
| S1 | −0.458 | −3.248 | 0.588 | 0.447 |
| S2 | 0.271 | 1.741 | 2.322 | 1.296 |
| S3 | – | 0.207 | 0.710 | 0.014 |
| S4 | – | 1.133 | 2.154 | 1.471 |
| S5 | – | 1.994 | 2.046 | 0.845 |
| S6 | −0.405 | 0.672 | 3.039 | – |
| S7 | −1.197 | – | 1.412 | 1.322 |
| S8 | 2.578 | 4.101 | 3.387 | 4.454 |
| S9 | 0.374 | 0.397 | −0.155 | 0.341 |
| S10 | 2.629 | 2.863 | 1.981 | – |
| S11 | −0.188 | −0.694 | −2.288 | 2.902 |
| S12 | – | – | – | 2.405 |
12 subjects × 4 conditions, 9 cells missing
If H₀ were true
- The reference: how SM varies across samples when H₀ is true (χ² approximation).
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .386).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- rank within subject i among its k_i observed conditions
- covariance of A under H₀ (one condition dropped)
The verdict
SM(3) = 3.04, p = .386
p > α = .050: compatible with H₀
A Friedman test that tolerates missing cells without dropping whole subjects. Subjects with fewer than two observations carry no information; the conditions must stay connected.
- Statistic
- 3.035
- p-value
- 0.3862
Skillings–Mack test on 12 subjects × 4 conditions, 9 cells missing: SM(3) = 3.04, p = .386. The p-value is above α = .050, so the data are compatible with H₀.
Question and hypotheses
H0: equal treatment effects with an incomplete block layout.
Assumptions
Independent blocks; observed treatment subsets fixed by design or missingness compatible with the null; a connected comparison network.
Formula
Parameters and notation
ki is observed block size; missing cells contribute zero. Without ties, Vjj=Σi:j observed(ki−1), Vjl=−number of blocks observing both j,l; V⁺ is a generalized inverse.
Structure of the method
Within each block, rank only observed treatments, center those ranks, and weight contributions by observed block size. Sum treatment scores and use their covariance generalized inverse to form a quadratic statistic. Covariance rank determines the effective chi-square dimension; conditional within-block permutations can supply a finite-design alternative.
Estimated and nuisance parameters
Computed quantities are weighted rank sums and the covariance induced by the observed comparison pattern, with tie adjustments where implemented. The treatment-incidence graph, block sizes, and missing-cell pattern are design or observation-process information. They cannot be treated as ignorable nuisance estimates when missingness depends on unobserved outcomes.
Settings and design choices
Specify alpha, tie treatment, generalized-inverse tolerance, reference method, and a missingness rationale. Examine graph connectivity before selecting degrees of freedom. Numerical tolerance should identify genuinely redundant contrasts rather than suppress poorly supported comparisons solely to obtain a favorable statistic or smaller nominal p-value.
Fitting and adaptation
Rebuild score covariance whenever the set of observed cells changes. Resampling must preserve the block-specific observation pattern under a justified null. If dropout is informative, model that mechanism or redesign the analysis; an incomplete-block rank test accommodates a layout but does not by itself correct selection bias.
Sensitivity and robustness
Disconnected comparison networks create untestable contrasts, and almost-disconnected layouts can be weakly informative. Single-observation blocks contribute no within-block treatment comparison. Many ties reduce covariance rank or variance. Independent blocks and appropriate exchangeability remain necessary even though the method is more flexible than Friedman about missing cells.
How to use and calibrate
Use χ²rank(V), usually k−1, or conditional block permutations. Tied data need an appropriate covariance adjustment.
Example application
Compare treatments with unequal but noninformative missing measurements across blocks.
Interpretation and pitfalls
Watch out
Informative dropout is not repaired by ranking. This is Skillings–Mack, distinct from the replicated cell Mack–Skillings test.
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
Missing block-treatment cells are NA; design connectivity and the missingness process matter.
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)
b <- matrix(rnorm(36)+rep(c(0,.3,.7),each=12),nrow=12,ncol=3)
b[cbind(c(1,3,8),c(2,1,3))] <- NA
print(PMCMRplus::skillingsMackTest(b))
"""
# 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)
b <- matrix(rnorm(36)+rep(c(0,.3,.7),each=12),nrow=12,ncol=3)
b[cbind(c(1,3,8),c(2,1,3))] <- NA
print(PMCMRplus::skillingsMackTest(b))
Sources
- PMCMRplus — PMCMRplus · skillingsMackTestAuthor documentation/source reviewed: PMCMRplus 1.9.12.search.r-project.org
- skillingsMackTestsearch.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 038, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT038.