Skip to content

BCompare groups · Guide test 036

Page L test

Tests a prespecified ordered treatment trend in repeated measures or complete blocks.

Runs in CodeSplashPython example validatedR 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 Alternative = Decreasing in the order below (Page's L) or choose Alternative = Increasing in the order below (Page's L).

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 · Page L test

10
4
0.40
1.5
0.050

Your data

Drag a point or use ↑/↓ to change it
Condition 1mean 1.17Condition 2mean 0.76Condition 3mean 1.44Condition 4mean 2.01

If H₀ were true

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

The formula

L=∑j=1kj Rj,z=L−nk(k+1)24nk2(k+1)(k2−1)144L = \sum_{j=1}^{k} j\,R_j,\qquad z = \dfrac{L-\frac{nk(k+1)^2}{4}}{\sqrt{\frac{nk^2(k+1)(k^2-1)}{144}}}

With your numbers

L=270,z=2.19L = 270,\quad z = 2.19
RjR_j
rank sum of condition j
jj
the hypothesized position

The verdict

L = 270.00, z = 2.19, p = .014

p ≤ α = .050: reject H₀

The ordered-alternative version of Friedman: much more powerful when the predicted order is right, blind to other patterns.

Statistic
2.191
p-value
0.0142
Page L test on Condition 1: n = 10; Condition 2: n = 10; Condition 3: n = 10; Condition 4: n = 10: L = 270.00, z = 2.19, p = .014. The p-value is below α = .050, so the data are hard to reconcile with H0.

Page L test on Condition 1: n = 10; Condition 2: n = 10; Condition 3: n = 10; Condition 4: n = 10: L = 270.00, z = 2.19, p = .014. The p-value is below α = .050, so the data are hard to reconcile with H₀.

Question and hypotheses

H0: equal treatment effects; H1: effects follow a prespecified order within blocks.

Assumptions

Independent complete blocks and within block exchangeability; ordered treatments selected in advance.

Formula

L=∑j=1kjRjL=\sum_{j=1}^{k}jR_j

Parameters and notation

Rj is treatment j’s total within block rank, with treatments arranged in the expected increasing order; b is block count.

Structure of the method

Rank outcomes within each complete block and weight each treatment's total rank by its prespecified position in the expected order. The Page L statistic grows with ordered concordance. Exact rank-distribution enumeration or a documented asymptotic normal reference calibrates the result; its directional nature is part of the hypothesis.

Estimated and nuisance parameters

Observed within-block ranks and treatment totals are computed, while the expected treatment ordering is fixed. No regression slope or numerical dose-response curve is estimated. Block count and treatment count determine the reference distribution; the order weights describe rank positions rather than arbitrary physical spacing of exposure values.

Settings and design choices

Specify expected order, direction, alpha, tie policy, and exact versus approximate method. Check the software's orientation: larger measured outcomes must correspond to larger expected ranks for the chosen increasing alternative. If multiple orderings are plausible, testing all and retaining the best requires simultaneous or search-aware calibration.

Fitting and adaptation

Recompute ranks after corrected observations while preserving the planned order. For a new repeated-measures experiment, randomization and counterbalancing may be needed to distinguish treatment from period effects. Adding occasions changes the statistic and reference distribution; do not reuse old critical values merely because subject count is unchanged.

Sensitivity and robustness

Time trends, learning, fatigue, and carryover can generate the same ordered pattern as a treatment effect. Tied outcomes and small designs require careful exact-calibration support. Significance does not establish a linear trend in physical units or significance of every adjacent contrast. Dependence between blocks remains outside the basic procedure.

How to use and calibrate

Use Page’s exact distribution for small designs or its standardized normal approximation; large L supports the ordered alternative.

Example application

Test whether performance improves over prespecified training stages across independent participants.

Interpretation and pitfalls

Watch out

Carryover or time trends can confound repeated treatment order. Do not reorder treatments using the observed results.

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

Rows are subjects/blocks and columns are treatments. Page uses the prespecified increasing column order.

Python · native

Validated — Executed successfully in the validation environment · needs numpy, scipy

import numpy as np
from scipy import stats
rng = np.random.default_rng(2026)
b = rng.normal(size=(12,3)) + np.array([0,.3,.7])
print(stats.page_trend_test(b))
Output
PageTrendTestResult(statistic=np.float64(148.0), pvalue=np.float64(0.24001290039869183), method='exact')
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)
print(PMCMRplus::pageTest(b,alternative="greater"))

Sources

Statistics guide v4 (historical):
R: Syntax checked; runtime not verified in the final environment
Reference's record:
Edition 2 review: Python: executed · R: not executed (Rscript unavailable). Python: Ran in the reference's review, on this exact code. R: Reviewed but not run: R wasn't available to the reference's authors.

From the CodeSplash statistics guide (v4), entry 036, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT036.