Page's Trend Test
Detects monotonic trend in k≥3 ordered repeated measures; more powerful than Friedman when trend expected.
What is it?
Page's Trend Testis a repeated measures test checking for an ordered, monotonic trend across linked treatments (e.g. baseline < mid-point < follow-up).
When to use it
- Linked Blocks: Repeated measures designs.
- Monotonic Trend Hypothesis: Ordered change is predicted across conditions.
Core Idea
Ranks conditions within subjects, weighting condition rank sums by their expected order coefficients (1, 2, 3). High agreement builds a strong slope:
Hypotheses
How it works
- Rank outcomes (1 to k) within each subject block separately.
- Calculate Rank Sums for each condition.
- Compute Page's L: L = sum(j * R_j) where j is expected index.
- Low p rejects H0, confirming ordered progression.
Assumptions
Effect Size
Measured using **Page L correlation coefficient**, indicating trend consistency across blocks.
Quick Example
| Condition | Rank Sum | Weight (j) |
|---|---|---|
| C1 | 12 | 1 |
| C2 | 24 | 2 |
| C3 | 36 | 3 (Significant L) |
Page's L Ordered Trend Live Laboratory
Increase the monotonic slope trend to align condition rank sums to expectation.
| Metric | Value |
|---|---|
| Observed Page L Stat | 143 |
| Expected L under H0 | 144.0 |
| Z-statistic | -0.102 |
| p-value | 0.9193 |
Hypotheses
Pragmatic null and alternative hypotheses defined in mathematical notation.
H₀: No trend across ordered conditions (θ₁ = θ₂ = ... = θₖ)
Hₐ: Monotonic trend exists (θ₁ ≤ θ₂ ≤ ... ≤ θₖ, with at least one strict inequality)
One-tailed test requiring a priori specification of trend direction. More powerful than Friedman test when ordered alternative is expected (e.g., dose-response, learning over time). Tests for monotonic trend in location parameters across k≥3 ordered repeated measures.
Assumptions
The core mathematical criteria needed to ensure that statistical testing remains unbiased and valid.
Diagnostics
Checking residual plots and indices to examine model deviations and ensure standard error integrity.
- If >70% of subjects show trend in predicted direction, Page's test is appropriate. If patterns are mixed or non-monotonic, trend may not exist
- Clear monotonic trend supports Page's test use. Non-monotonic pattern (e.g., inverted-U) violates ordered alternative assumption
- Higher weighted rank sums indicate stronger trend. L statistic summarizes these weighted sums across subjects
- Significant Friedman (p < .05) suggests differences exist; Page's test determines if difference follows predicted trend. Non-significant Friedman suggests no effect
- Standardized L ranges 0-1 (no trend to perfect trend). Tau >0.3 = medium effect, >0.5 = large effect
- High % of subjects with positive tau supports population-level trend. Heterogeneity suggests individual differences in trend
- If L similar for both directions, pattern may be non-monotonic or U-shaped rather than linear trend
- If Friedman p < Page's p, trend may not be monotonic. Page's is more powerful only for ordered alternatives
- Robust rank methods reduce outlier impact. Large changes suggest sensitivity analysis needed
- Monotonic trend shows consistent cumulative increases (or decreases) across all transitions
- CI excluding null value (expected L under H₀) confirms significance. Width indicates precision
- Power <0.8 with significant result suggests lucky finding or overestimated effect. Power >0.9 indicates robust detection
- Page's test detects any monotonic trend (linear or non-linear). Linear trend suggests dose-response; non-linear suggests threshold effects
Applied Minds
Review concrete study examples, data layout guidelines, and copy executable syntax scripts.
Drug Dose-Response on Pain Relief (4 Ordered Levels)
Classic dose-response design with ordered conditions. Page's test is ideal because: (1) within-subjects design, (2) 4 ordered dose levels with a priori predicted increasing trend, (3) more powerful than Friedman when monotonic trend expected.
# Page's Trend Test: Drug Dose-Response Example
# ================================================================
# Research Question: Do increasing analgesic doses produce
# monotonically increasing pain relief?
# Load packages
library(crank) # page.test()
library(tidyverse)
library(DescTools) # KendallW()
# Create data: 15 patients × 4 doses
set.seed(123)
patient_id <- rep(1:15, each = 4)
dose <- rep(c(0, 50, 100, 200), times = 15)
# Simulate pain relief with monotonic trend + noise
base_relief <- case_when(
dose == 0 ~ rnorm(15, mean = 2, sd = 1),
dose == 50 ~ rnorm(15, mean = 4, sd = 1.2),
dose == 100 ~ rnorm(15, mean = 6, sd = 1.3),
dose == 200 ~ rnorm(15, mean = 7.5, sd = 1.5)
)
pain_data <- data.frame(
patient = factor(patient_id),
dose = factor(dose, levels = c("0", "50", "100", "200")),
dose_numeric = dose,
relief = pmax(0, pmin(10, base_relief)) # Bound 0-10
)
# -------- ASSUMPTION CHECKS --------
# 1. Check design: within-subjects, ordered conditions
cat("Design check:\n")
cat("Subjects:", length(unique(pain_data$patient)), "\n")
cat("Conditions(ordered):", nlevels(pain_data$dose), "\n")
cat("Measurements per subject:", table(table(pain_data$patient)), "\n\n")
# 2. Visualize individual trends (spaghetti plot)
ggplot(pain_data, aes(x = dose, y = relief, group = patient)) +
geom_line(alpha = 0.3) +
geom_point(alpha = 0.5) +
stat_summary(aes(group = 1), fun = mean, geom = "line",
color = "red", size = 1.5) +
labs(title = "Individual Dose-Response Profiles",
subtitle = "Red line = mean trend",
x = "Dose(mg)", y = "Pain Relief(0-10)") +
theme_minimal()
# 3. Check for monotonic pattern in means
mean_relief <- pain_data %>%
group_by(dose) %>%
summarise(mean_relief = mean(relief),
median_relief = median(relief),
se = sd(relief)/sqrt(n()))
print(mean_relief)
# 4. Calculate within-subject ranks
pain_wide <- pain_data %>%
pivot_wider(names_from = dose, values_from = relief)
ranks <- t(apply(pain_wide[, -1], 1, rank))
colnames(ranks) <- c("Dose_0", "Dose_50", "Dose_100", "Dose_200")
cat("\nMean ranks per dose:\n")
print(colMeans(ranks))
# -------- PAGE'S TREND TEST --------
# Specify expected order: 1, 2, 3, 4 (increasing)
expected_order <- c(1, 2, 3, 4)
# Run Page's L test
page_result <- page.test(
x = pain_wide[, c("0", "50", "100", "200")],
ranks = expected_order
)
cat("\n=== PAGE'S TREND TEST ===\n")
print(page_result)
# -------- EFFECT SIZE --------
# Standardized L (L ranges from minimum to maximum possible)
L_obs <- page_result$statistic
k <- 4 # conditions
n <- 15 # subjects
# L ranges from k(k+1)n/2 (no trend) to k²(k+1)n/4 (perfect trend)
L_min <- k * (k + 1) * n / 2
L_max <- k^2 * (k + 1) * n / 4
L_standardized <- (L_obs - L_min) / (L_max - L_min)
cat("\nEffect Size:\n")
cat("L statistic:", L_obs, "\n")
cat("Standardized L:", round(L_standardized, 3), "(0=no trend, 1=perfect)\n")
# Kendall's W (concordance coefficient)
friedman_data <- as.matrix(pain_wide[, -1])
kendall_w <- KendallW(friedman_data, correct = TRUE)
cat("Kendall's W:", round(kendall_w, 3), "(concordance)\n")
# -------- COMPARISON WITH FRIEDMAN --------
friedman_result <- friedman.test(relief ~ dose | patient, data = pain_data)
cat("\nFriedman test(omnibus):\n")
cat("Chi-square =", friedman_result$statistic, ", p =",
format.pval(friedman_result$p.value, digits = 3), "\n")
# -------- VISUALIZATION --------
# Plot mean trend with error bars
ggplot(mean_relief, aes(x = dose, y = mean_relief, group = 1)) +
geom_line(size = 1.2, color = "steelblue") +
geom_point(size = 3, color = "steelblue") +
geom_errorbar(aes(ymin = mean_relief - se, ymax = mean_relief + se),
width = 0.2) +
labs(title = "Dose-Response Trend: Mean Pain Relief",
x = "Dose(mg)", y = "Mean Pain Relief ± SE") +
theme_minimal()
# -------- INTERPRETATION --------
cat("\n=== INTERPRETATION ===\n")
if (page_result$p.value < 0.05) {
cat("Significant monotonic trend detected(p <",
format.pval(page_result$p.value, digits = 3), ")\n")
cat("Conclusion: Pain relief increases monotonically with dose.\n")
cat("Effect size(standardized L =", round(L_standardized, 3),
") indicates",
ifelse(L_standardized > 0.5, "strong", "moderate"), "trend.\n")
} else {
cat("No significant trend(p =",
format.pval(page_result$p.value, digits = 3), ")\n")
}
Alternatives
Structured fallback pathways for choosing alternative tests when normality or slopes requirements fail.
- Friedman Test — Switch to the omnibus rank audit if the data 'Wiggles' (improving then declining).
- Quadratic RM ANOVA — Model the 'U-shape' curve using parametric polynomial terms.
- Trend ANOVA Strike — Reclaim 15% power by utilizing mean-based linear contrasts.
Post-hoc
Group mean comparisons and correction controls (e.g. Tukey HSD, Bonferroni) to protect against Family-Wise Error Rates.
Post-hoc pairwise tests defined for this model.
No specific guidelines provided.
Effect Size
Understanding effect sizes (e.g., Cohen's d, Partial Eta-Squared) and clinical impact benchmarks.
Sample Size
Guidelines for minimum sample requirements and power analysis parameters.
The 'Ordered-RM' Minimum: A minimum of 10 participants and 3 timepoints is essential. Page's test is a trend-specific audit—if you have too few levels, the 'Rank-Progression' becomes invisible.
| Effect Size | Parameters | Required n |
|---|---|---|
| Small Effect | Subtle Trend (L) | n ≈ 60 |
| Medium Effect | Moderate Trend (L) | n ≈ 25 |
| Large Effect | Strong Trend (L) | n ≈ 12 |
The 'Directional Mandate': Page's power is concentrated in a single direction (e.g., Week 1 < 2 < 3). If your data follows a complex curve (improving then declining), Page will 'Collapse' and yield a non-significant result even if a trend exists.
Reporting
How to compile statistical results into publication prose matching APA and journal style guides.
Manuscript Lab
Copy standard summary tables and forensic reporting grids to outline analysis details.
| Timepoint | Median | Mean Rank | L (Statistic) | z | p (Trend) |
|---|---|---|---|---|---|
| Baseline | 42.0 | 1.42 | 542.5 | 4.12 | < .001 |
| Month 6 | 55.0 | 2.15 | — | — | — |
| Month 12 | 62.0 | 2.43 | — | — | — |
The Trend Matcher. Calculated by weighting the mean ranks of each timepoint by their expected order. Higher L = better fit to the trend.
Linear Median Probability. Proves that subjects are moving in the hypothesized direction significantly more than random chance.
Command Center
Syntax libraries and function parameters for executing calculations in stats packages.
# 1. Execute Page's L Trend Test
DescTools::PageTest(as.matrix(df_wide))
# 2. Advanced Trend Audit
PMCMRplus::pageTest(as.matrix(df_wide))Friedman only tests if 'any' difference exists. Page tests if 'this specific' direction exists. Only use Page if you have a theoretical reason to expect an order.
# Compare Friedman vs Page p-values.
# Page should yield a much lower p-value if the trend is correct.Common Mistakes
Analytical caveats and corrections to maintain modeling integrity.
References
Scholarly lineage and citation keys grounding the statistical framework.