Why is mathematics important when we predict an order before collecting data? Because “the groups differ” and “the groups follow this particular progression” are not the same claim. Page’s trend test uses ranks within matched blocks to assess a prespecified ordering across several treatments or conditions. It is a focused way to turn a directional scientific expectation into a checkable statistic.
Imagine the same four sensors tested under low, medium and high reference inputs. The prediction is that readings rise in that order, although some sensors have consistently higher baselines than others. Ranking within each sensor removes its baseline from the comparison and retains whether its readings follow the predicted sequence.
This article explains Page’s L statistic, an exact four-block example, the importance of choosing the order in advance, and the limits of interpreting a rank trend. The examples are invented for teaching. They are not evidence that any real educational programme, device or treatment produces the described effect.
Choose your reading route
Start with the question, follow the mechanism, or jump straight to the checked calculation. All teaching sections remain open below.
The design comes before the formula · State the expected order in advance · Worked example: four blocks, three conditions · Ties change the calibration question · Practice questions and answers
Full section index · eduKateSG Mathematics
Full section index
Sections 1–6
Sections 7–12
Sections 13–18
Sections 19–24
Did You Know? A method designed for an ordered alternative can detect a pattern that an unfocused all-differences question treats less efficiently. The advantage comes from a genuine prior prediction. If you discover the order after seeing the results, you have spent that advantage and must not pretend otherwise.
The design comes before the formula
Arrange the data as m independent blocks and n conditions. A block is a unit observed under every condition: a participant, specimen, machine or another appropriate matched unit. Conditions occupy columns, and the same column must mean the same thing in every row.
The matching is essential. Some blocks may have large values under every condition, while others are low throughout. Comparing raw column averages can mix that between-block variation with the ordered condition pattern. Within-block ranks focus on relative positions inside each block.
Page’s test is not the correct default for three unrelated groups of people. Nor does a rectangular spreadsheet create matching where none existed. The block structure must come from the study design and the scientific unit, not from putting values next to each other.
Across blocks, independence still matters. Repeated visits from one person are not automatically separate independent blocks. If blocks share clusters or time dependence, the null distribution needs a design-aware treatment rather than an uncritical application of the standard table.
State the expected order in advance
Suppose the prediction is condition A<B<C in the outcome of interest. Assign predicted ranks 1,2,3 to those columns. These are the weights that encode the hypothesis. For a decreasing prediction, reverse the order or supply a corresponding predicted-rank mapping before analysing the data.
The prediction might arise from a physical mechanism, a dose ordering or an independently established theory. It should not be copied from the observed column totals. Otherwise the same data both create the hypothesis and provide apparently confirmatory evidence for it.
An ordered alternative does not require every individual row to increase perfectly. Sampling noise, individual differences and occasional reversals can occur. The test combines the extent of agreement across blocks into one statistic.
It also does not establish that increases are equally spaced. A rank order of low, medium, high says nothing about whether the change from low to medium equals the change from medium to high. Equal rank spacing is a scoring convention, not a claim about physical effect size.
Back to contents · Previous · Next
Rank within each row
For each block, assign rank 1 to the smallest observation and rank n to the largest. If observations tie, use their average occupied ranks under the documented convention. With three values [5,5,9], the ranks are [1.5,1.5,3].
Every untied row has the same rank sum n(n+1)/2. This is why a consistently high-baseline block does not dominate merely because its measurements are numerically large. A row [100,200,300] and a row [1,2,3] have the same rank pattern.
That invariance has a cost: the size of the gaps is discarded. The method treats an increase of one unit and an increase of one hundred units alike when the ordering is identical. Retain the raw measurements so practical magnitude can be reported separately.
A strictly increasing transformation applied within a block preserves its ordering. Rounding may not, because it can create ties. A decreasing transformation reverses the ranks and therefore changes the directional interpretation. These checks help students connect functions and inequalities with statistical reasoning.
Back to contents · Previous · Next
Build Page’s L statistic
Add the observed ranks down each condition column to obtain R₁,…,R_n. If q_j is the predicted rank for condition j, then L=Σq_jR_j. A large L means conditions predicted to be high tend to have high observed rank sums.
The statistic is a dot product between a predicted pattern and an observed pattern. It rewards alignment. That linear-algebra viewpoint makes the test easier to remember than a disconnected recipe: one vector describes the prior order and the other describes the evidence.
For m blocks and n untied conditions under the usual null permutation model, E₀=m n(n+1)²/4. The null variance is V₀=m n²(n+1)(n²−1)/144. Standardising gives Z=(L−E₀)/√V₀ for an asymptotic one-sided normal reference.
The upper tail matters because the chosen direction predicts large L. Squaring the standardised departure would erase direction and mix agreement with anti-agreement. A strong reversal should not be presented as support for the original increasing prediction.
Back to contents · Previous · Next
Worked example: four blocks, three conditions
Consider four rows of measurements: [2,4,6], [5,9,7], [10,12,14] and [3,8,11]. The predicted column order is A<B<C, declared before viewing these observations. The second block partly reverses the final two conditions, so the example is not perfectly ordered.
The within-row ranks are [1,2,3], [1,3,2], [1,2,3] and [1,2,3]. Their column totals are [4,9,11]. Multiply by predicted ranks [1,2,3]: L=1×4+2×9+3×11=4+18+33=55.
For m=4,n=3, the null expectation is E₀=4×3×16/4=48. The variance is V₀=4×9×4×8/144=8. Thus Z=(55−48)/√8≈2.47487, giving an asymptotic upper-tail p≈0.00666416.
The exact untied permutation calculation gives p=0.00694444. SciPy 1.17.0 independently reproduced L=55 and both p-values when the methods were specified explicitly. The close agreement is reassuring in this particular example, not a reason to assume approximations are always interchangeable.
At a predeclared 5% threshold, the data support the ordered alternative under the null model. They do not show that every block follows the order, that differences are equally large, or that the condition labels caused the pattern without a suitable experimental design.
Back to contents · Previous · Next
Counting the exact tail
With three untied conditions, each block can have 3!=6 rank permutations under a null in which condition labels are exchangeable within that block. Four independent blocks therefore produce 6⁴=1296 equally weighted combinations in this simple exact reference.
A row perfectly aligned with [1,2,3] contributes 1²+2²+3²=14. Swapping either adjacent pair reduces the row contribution to 13. The six possible row contributions are 14,13,13,11,11,10.
The maximum total is 4×14=56. To obtain L≥55, either every row contributes 14, or exactly one row contributes 13 while the other three contribute 14. There is one all-perfect combination and 4×2=8 combinations with one adjacent reversal.
The upper tail contains 9 combinations, so p=9/1296=1/144≈0.00694444. This direct counting explains the exact result without relying on a black-box routine. It also shows why exact p-values are discrete: the reference contains a finite set of possible arrangements.
Back to contents · Previous · Next
A reversal is not evidence for the prediction
Reverse every row’s condition order in the example. For three conditions, the predicted-rank weights become misaligned with the observed rankings. L becomes small rather than large, and an upper-tail test should not report support for the increasing alternative.
There is a useful complement identity. With predicted ranks 1,…,n and every row summing to n(n+1)/2, reversing the weights gives L_reverse=m n(n+1)²/2−L. The two statistics sum to twice their null expectation.
For our four-by-three table that constant is 96, so L_reverse=96−55=41. The original expectation is 48; 55 and 41 sit symmetrically around it. This is a strong arithmetic check for an implementation that claims to handle direction correctly.
Do not inspect the data, choose the more favourable direction and report an unadjusted one-sided p-value. That is a different procedure with a different error rate. An exploratory reversal can be valuable, but it must be labelled and confirmed appropriately.
Back to contents · Previous · Next
Ties change the calibration question
Within-row ties receive average ranks, which makes L straightforward to calculate. The exact distribution becomes more subtle because tied rank patterns do not have the same variability as permutations of distinct ranks.
SciPy’s current documentation explicitly cautions that its Page p-values are not adjusted for ties. Its reported exact p-values may be conservative in tied settings, while the asymptotic values tend to be smaller than its exact reference. “Exact” therefore needs a stated reference, not an assumption that every tie pattern was handled exactly.
If ties are frequent, investigate a conditional permutation calculation that preserves each row’s observed tied values, or use a suitable alternative model. The validity still depends on exchangeability under the actual design. A custom randomisation routine needs its own checking and should not silently inherit the label of another procedure.
Do not add random noise merely to obtain untied ranks. That invents distinctions the measurement did not contain. If an instrument rounded values, seek the authorised original precision where possible; otherwise retain the limitation honestly.
Back to contents · Previous · Next
Trend does not mean a straight line
Page’s use of linear rank weights sometimes leads to the phrase “linear trend”. In this context the important object is alignment with an ordered rank prediction, not a fitted straight line in the original units.
Consider condition values that rise from 1 to 2 to 100. The ranks are [1,2,3], just as for 1,2,3. The final large jump is not given ninety-eight times the influence of the first. The statistic does not estimate a slope per unit of dose.
If the physical dose levels are 1,10,100, equal rank steps do not encode their unequal numerical spacing. A regression or another model using actual dose values may be more informative when the scientific question concerns a response curve or rate of change.
An ordered-rank analysis is useful when the order is defensible but metric spacing is not. That is a legitimate modelling choice. It becomes misleading only when its result is translated into a numerical dose-response claim the method never estimated.
Back to contents · Previous · Next
Page versus an omnibus blocked comparison
A broad blocked comparison asks whether any condition differs from the others. Page’s test asks whether the conditions tend to follow one prespecified order. A U-shaped pattern may show substantial differences but offer little support for the ordered prediction.
For example, A low, B high, C low contradicts an increasing A<B<C story even if B differs strongly from both neighbours. The appropriate conclusion is not that Page failed to discover the truth; the ordered hypothesis was not the right description of that pattern.
Conversely, a modest but consistent progression across many blocks can be meaningful evidence for the ordered alternative. Using prior structure concentrates the question. This is a general lesson in mathematics: a stronger justified constraint can sharpen an inference.
Choose between an ordered and unordered question before analysing. If both are scientifically important, specify both and manage the inferential plan. Running several tests and reporting whichever appears strongest obscures what the evidence was supposed to establish.
Back to contents · Previous · Next
Experimental order is not treatment order
The predicted order A<B<C concerns outcome levels, not necessarily the order in which conditions should be administered. Giving everyone A first, B second and C third can confound condition with practice, fatigue or elapsed time.
Randomisation or counterbalancing can help separate those influences when ethically and practically appropriate. In other contexts, order cannot be changed, and the analysis needs to acknowledge that limitation or use a more detailed longitudinal model.
For a learner testing three interface designs, doing them in the same sequence for everyone may make the last design look faster because participants have learned the task. A statistically convincing rank order would still not identify the design itself as the cause.
Write two separate columns in the project plan: predicted outcome order and administration order. Confusing them is a design error that no rank calculation can fix. This distinction is particularly useful for students moving from classroom experiments toward real research.
Back to contents · Previous · Next
An investigation with calibration standards
Use synthetic readings from several sensors under three known reference inputs. Give each sensor a different baseline, but add an increasing condition response. Rank within sensors and calculate L. The rank analysis should retain the progression despite the baseline variation.
Next increase the sensor baselines by different positive constants while leaving within-sensor differences unchanged. L should remain identical. If it changes, the implementation may be ranking down columns rather than across rows.
Then add a sensor-specific disturbance that reverses two conditions. Observe how its rank contribution falls from the maximum. This demonstrates how the global statistic aggregates partial evidence rather than demanding perfect agreement.
Keep the raw-unit readings as well. A sensor may follow the correct order while having an unacceptable calibration error or weak sensitivity. Ordered response is one performance property, not a complete quality assessment.
Back to contents · Previous · Next
An investigation with preference ratings
Suppose participants rate three hypothetical package designs, and an independent theory predicts a particular preference order. Each participant supplies one row. The study can examine whether the ranking evidence aligns with that prior order.
Preference ratings often tie. That makes the tie-calibration limitation central rather than a footnote. A five-point scale is not secretly continuous just because the numbers are entered into a spreadsheet.
Recruitment also matters. A convenience panel of friends does not represent all consumers. Statistical evidence about the sampled population should not be expanded into a universal marketing claim without a defensible sampling argument.
This example connects mathematics to design careers without promising that a test selects the best design automatically. Design judgement also includes accessibility, usability, cost, context and qualitative feedback. A preference trend addresses only one component.
Back to contents · Previous · Next
An investigation with learning tasks
A student might compare three levels of task support and predict increasing success scores. The same learners attempt equivalent tasks under each condition. Page’s framework illustrates how matching preserves stable differences between learners.
But equivalent tasks and order control are difficult. If the most supported condition also has easier questions or always comes last, the rank pattern may reflect those differences. A careful project should describe these as competing explanations, not hide them behind a p-value.
For ordinary enrichment, synthetic data are often the better choice. Students can learn blocking, ranks and exact counting without experimenting on classmates or making claims about teaching effectiveness from a tiny informal study.
The importance of mathematics in education includes learning to ask narrower questions. “Did this table align with our predicted order?” is answerable under clear assumptions. “Have we proved the best teaching method?” is not established by this calculation.
Back to contents · Previous · Next
Missing observations need a plan
The classical layout expects each block to contain all conditions. If a participant skips one condition, the within-row ranking no longer has the same interpretation as the complete n-condition rows. Filling the cell with zero is not a neutral solution.
A complete-case analysis may be simple, but it changes the analysed sample and can be biased if missingness relates to outcomes. Model-based approaches may be preferable, yet they add assumptions that need to be made visible.
Record why each value is missing. Equipment failure, refusal, time limits and an inapplicable condition can imply very different mechanisms. A missing score is not automatically a low score, and treating it as one can manufacture a trend.
For a student investigation, a small missing-data sensitivity exercise is valuable: compare the complete-case result with plausible alternative scenarios, labelled as scenarios rather than observed facts. The goal is to understand fragility, not to choose an imputation that creates significance.
Back to contents · Previous · Next
Reporting magnitude beside a rank trend
L measures alignment on a rank scale. Its raw value also depends on the number of blocks and conditions. Comparing L=100 from one design with L=60 from another does not automatically tell us which effect is larger.
Report raw condition summaries and within-block contrasts in meaningful units. A highly consistent progression may still be tiny in practice, while a less consistent progression may include substantial changes for particular blocks.
Show individual block trajectories when privacy and scale permit. A plot can reveal whether one condition is usually highest, whether reversals cluster in a subgroup and whether the raw differences vary dramatically. These observations are descriptive unless supported by a preplanned subgroup analysis.
Avoid saying that a small p-value measures the probability of a monotonic law. It measures a tail area under a specific null reference. The substantive effect, uncertainty and generalisability require their own evidence.
Back to contents · Previous · Next
A student’s route through the mathematics
Begin with ordinal comparisons and average ranks. Rank a few rows by hand, including one tie, then check that every row sum matches n(n+1)/2. This is a useful bridge from elementary arithmetic to data representation.
Next calculate column sums and the dot product with predicted ranks. Draw arrows from the prediction vector to the observed vector to explain why agreement increases L. The statistic becomes a relationship rather than a memorised expression.
Then enumerate all permutations for one three-condition block. Calculate the six contributions 14,13,13,11,11,10. Combine two blocks before attempting four. This builds a sampling distribution from finite counting that a student can genuinely understand.
Finally connect exact enumeration with an asymptotic normal approximation. Compare the two p-values on manufactured examples, and ask why ties or small dimensions can matter. This sequence develops probability, algebra, computational thinking and careful scientific communication together.
Back to contents · Previous · Next
Guidance for parents and educators
Ask the student to explain what was predicted before the data were seen. If the answer is vague, pause before calculating anything. A clear prior order is the defining feature of this method, not an optional detail.
Help the learner distinguish a useful simplification from lost information. Ranks remove baseline differences and numerical gaps; that can be appropriate, but the raw values should remain available. “What did we keep, and what did we discard?” is an excellent recurring question.
Use supportive error checks. If a student ranks down columns accidentally, compare two rows with very different baselines and show why the intended block comparison was lost. Repair the representation before correcting the final statistic.
Advanced statistics is enrichment, not a promise of exam results or a fixed career pathway. Secure algebra, fractions, functions and graph reading remain valuable foundations. Curiosity is best supported by a pace at which the learner can explain the mechanism and its limits without reciting jargon.
Back to contents · Previous · Next
Practice questions and answers
Question 1: A row has values [9,3,6] in columns A,B,C. Its within-row ranks are [3,1,2]. With predicted ranks [1,2,3], the contribution is 1×3+2×1+3×2=11. The row does not support the increasing prediction strongly.
Question 2: Add 50 to all three values in that row. The ranks and contribution stay unchanged. This checks the intended removal of block baseline, not a claim that raw-unit differences never matter scientifically.
Question 3: What is the largest contribution for an untied three-condition row? It is 14, attained by [1,2,3] aligned with [1,2,3]. The smallest is 10, attained by [3,2,1]. Enumerating all six permutations verifies both bounds.
Question 4: Can you reorder columns after inspecting their sums? You can do it for exploration, but not report the resulting unadjusted one-sided test as though the order had been predicted. Keep discovery separate from confirmation.
Question 5: Does rejection prove every condition pair differs? No. Page’s is a global ordered test. Pairwise claims require their own preplanned comparisons, uncertainty and multiplicity handling.
Back to contents · Previous · Next
A closer look at information lost by ranking
Two blocks [1,2,3] and [1,2,100] contribute the same rank pattern. If the purpose is detecting ordered tendency, this is intentional. If the purpose is estimating benefit, the difference between three and one hundred may be central. A test can be well matched to one question and incomplete for another.
Ranking also treats an almost-tie and a large gap differently only when their order differs or a tie is recorded. With high-precision measurements, [1,1.001,1.002] is a perfectly ordered row. With values rounded to two decimals, the same measurements may all tie. The instrument’s resolution therefore affects the available rank information.
Do not select precision after seeing which version gives a smaller p-value. Use the measurement process and a documented rule. If practical differences below a tolerance are considered indistinguishable, define that rule scientifically rather than treating it as an inferential convenience.
An informative report can show both rank trajectories and original-unit trajectories. The first emphasises order; the second shows magnitude. When the two displays suggest different practical impressions, explain the difference instead of choosing whichever graphic supports the preferred story.
Back to contents · Previous · Next
An exact two-block exercise
For two blocks and three untied conditions there are 6²=36 equally weighted rank arrangements under the simple permutation null. The largest L is 28, occurring when both rows contribute 14. The probability of exactly this maximum is 1/36.
To reach L≥27, include the maximum case and the cases with one row contribution 13 and one contribution 14. There are two choices of which row is imperfect and two adjacent-swap arrangements for that row, giving four additional cases. The upper-tail probability is therefore 5/36≈0.138889.
This is a useful surprise: two nearly perfect rows do not necessarily provide enough evidence for a 5% decision. The finite reference distribution limits the resolution of the inference. Strong-looking patterns in tiny datasets need not support strong population conclusions.
Ask students to compare this with our four-block example. The statistic is larger partly because there are more blocks, so raw L values should not be compared as effect sizes. The exact tail calculation explains how additional independent blocks make a consistent pattern less likely under the null.
Back to contents · Previous · Next
Simulation should preserve blocks
To simulate a null dataset, generate each block’s condition values according to a model with no systematic condition ordering, or permute condition labels within each block under a justified exchangeability assumption. Do not shuffle every cell freely across the entire matrix: that destroys the block structure the method is designed to preserve.
For an alternative simulation, introduce an increasing condition effect while allowing block baselines to vary. Record how often the prespecified test rejects across repeated datasets. That frequency estimates power only for that particular sample size, noise model and effect pattern.
Repeat for an ordered-but-uneven response and for a U-shaped response. The contrast shows why a targeted ordered test is not a general detector of all condition differences. A simulation should include failure cases as well as a favourable demonstration.
If ties are introduced by rounding, separately inspect the documented calibration limitation. Do not assume that a simulation without ties validates later analyses with a coarse rating scale. The data-generation model must include the features that could challenge the intended use.
Back to contents · Previous · Next
A practical decision worksheet
Before analysis, write the conditions in their scientific order and state what evidence led to that prediction. Then list the independent blocks and identify any shared influences. This first page is a design record, not a results sheet.
On the second page, preserve the raw matrix and within-row ranks. Show every tie and missing value explicitly. Add column rank sums, predicted-rank weights and the calculation of L so another reader can trace the result without running software.
On the third page, report the exact or approximate reference, the selected decision threshold and the practical summaries in original units. Include a sentence explaining what would have contradicted the prediction. If no possible data pattern was allowed to count against the story, it was not a meaningful test.
End with a restrained conclusion and a next step. A sensor project might require a calibration study; a preference project might need a more representative panel; an educational illustration might stop at explaining the statistics. A p-value should inform the next question rather than close every discussion.
Back to contents · Previous · Next
Common language errors to repair
- Replace “the trend is proven” with a statement about evidence under the declared design and null reference.
- Replace “all pairs differ” with the actual global ordered conclusion unless pairwise work supports more.
- Replace “exact despite ties” with the documented reference and its tie limitation.
- Replace “the largest L is the biggest effect” with an interpretation accounting for blocks and conditions.
- Replace “we predicted the order after seeing it” with an honest exploratory description.
- Replace “ranked data need no assumptions” with explicit matching, independence and exchangeability requirements.
These corrections are not merely cautious wording. Each repairs a different logical leap: from sample to population, global to local, approximation to certainty, statistic to magnitude, discovery to confirmation or calculation to design validity. Learning to recognise those leaps is one of the most transferable benefits of studying statistics.
Back to contents · Previous · Next
Frequently asked questions
Is Page’s test a correlation test?
It measures alignment between a predicted treatment order and observed within-block ranks, but its design is a blocked multi-condition experiment. It is not a general replacement for correlation between two freely varying measurements.
Can different blocks have different baselines?
Yes. Ranking within each block removes a constant baseline from the ordering calculation. It does not remove arbitrary interactions, condition-specific measurement errors or dependence between blocks.
Must every row follow the prediction?
No. Partial reversals can occur, and L aggregates the overall alignment. Our worked example contains one adjacent reversal yet provides strong evidence under the stated untied reference.
Does the test estimate a slope?
No. It uses rank ordering and does not quantify change per unit of a numerical dose. Use an appropriate regression or response model when slope or curve shape is the target.
What should be recorded for reproducibility?
Keep the raw matrix, block and condition definitions, predicted ranks, tie convention, missing-data decisions, software version and exact or asymptotic method. Those choices define the analysis more fully than the name alone.
What is the wider lesson?
A prior order is mathematical information. Used honestly, it focuses a question; chosen afterwards, it creates an unacknowledged search. Learning that distinction improves research literacy far beyond this particular statistic.
Back to contents · Previous · Next
Preserve the prediction as an artefact
Write the expected condition order, its scientific reason and the planned test in a dated project note before collecting or opening the outcome data. For a classroom investigation, a teacher-held note is enough to make the distinction between prediction and discovery tangible.
If the prediction changes after preliminary work, record that change and explain which data informed it. There is nothing wrong with learning from a pilot study. The important step is to reserve genuinely new evidence for confirmation or explicitly account for the exploratory process.
This practice develops an unusually valuable problem-solving skill: separating what we expected, what we observed and what we revised. The calculation of L is short; preserving those three categories is what makes its interpretation trustworthy.
Back to contents · Previous · Next
Useful next reading and sources
Page introduced the method in the 1963 paper Ordered Hypotheses for Multiple Treatments: A Significance Test for Linear Ranks. SciPy’s Page trend-test documentation explains current input conventions, exact and asymptotic methods, and its important tie warning.
For matched outcomes that are binary rather than ranked measurements, read Cochran’s Q and repeated proportions. For a different paired categorical question, Bowker symmetry and directional category changes compares opposite transitions rather than an ordered rank prediction.
Continue at the eduKateSG Mathematics hub. Mathematics matters here because it preserves matching, expresses a prediction precisely and makes the difference between a discovered pattern and a tested expectation impossible to ignore.
