Skip to content

BCompare groups · Guide test 038

Skillings–Mack test

Extends Friedman type inference to incomplete blocks and missing observations in suitable designs.

Runs in CodeSplashPython (calls R) example not runR example not run

Do it in CodeSplash

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

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

12
4
0.15
0.40
1.2
0.050

Your data

Some subjects miss some conditions
SubjectC1C2C3C4
S1−0.458−3.2480.5880.447
S20.2711.7412.3221.296
S3–0.2070.7100.014
S4–1.1332.1541.471
S5–1.9942.0460.845
S6−0.4050.6723.039–
S7−1.197–1.4121.322
S82.5784.1013.3874.454
S90.3740.397−0.1550.341
S102.6292.8631.981–
S11−0.188−0.694−2.2882.902
S12–––2.405

12 subjects × 4 conditions, 9 cells missing

If H₀ were true

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

The formula

SM=A⊤Σ−A,Aj=∑i12ki+1(Rij−ki+12)SM = A^{\top}\Sigma^{-}A,\quad A_j=\sum_i \sqrt{\tfrac{12}{k_i+1}}\left(R_{ij}-\tfrac{k_i+1}{2}\right)

With your numbers

SM=3.04,t−1=3SM = 3.04,\qquad t-1 = 3
RijR_{ij}
rank within subject i among its k_i observed conditions
Σ\Sigma
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 H0.

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

Aj=∑i12/(ki+1)[Rij−(ki+1)/2]T=ATV+A\begin{gathered}A_j=\sum_i\sqrt{12/(k_i+1)}[R_{ij}-(k_i+1)/2]\\[5pt] T=A^TV^+A\end{gathered}

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.

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)
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()
R

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

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.