BCompare groups · Guide test 035
Quade test
Compares treatments in complete blocks while weighting blocks by their observed response ranges.
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 = Quade.
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 · Quade test
Your data
Drag a point or use ↑/↓ to change itIf H₀ were true
- The reference: how F varies across samples when H₀ is true.
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .201).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- rank of block i's range
- total and between-condition sums of squares
The verdict
F(3, 27) = 1.65, p = .201
p > α = .050: compatible with H₀
Weights blocks by how much they vary, so it beats Friedman when few conditions are compared across noisy blocks.
- Statistic
- 1.653
- p-value
- 0.2006
Quade test on Condition 1: n = 10; Condition 2: n = 10; Condition 3: n = 10; Condition 4: n = 10: F(3, 27) = 1.65, p = .201. The p-value is above α = .050, so the data are compatible with H₀.
Question and hypotheses
H0: equal treatment effects in a complete block design.
Assumptions
Independent complete blocks; quantitative measurements so within block ranges have meaning; exchangeability within blocks.
Formula
Parameters and notation
qi is the rank of block i’s response range among the b blocks; Rij is a within block rank.
Structure of the method
Rank treatments within complete blocks, rank the observed ranges across blocks, and multiply centered within-block ranks by range ranks. Treatment sums of these weighted scores form an F-type ratio. A blockwise permutation recomputes the relevant treatment arrangement while retaining the quantitative range information associated with each block.
Estimated and nuisance parameters
Estimate block ranges, their ranks, centered treatment ranks, and weighted treatment totals. No Gaussian residual variance is fitted. The range weighting is part of the algorithm rather than a tunable coefficient, and the block structure and treatment identities are design quantities supplied before observing significance.
Settings and design choices
Choose alpha, approximation versus within-block permutation, tie handling, and any post-hoc comparison family. Because ranges use measurement magnitudes, verify that the numerical scale is meaningful. A monotone nonlinear transformation can alter range ordering and therefore the Quade result even though ordinary within-block ranks remain unchanged.
Fitting and adaptation
Refit by recalculating both treatment ranks and block-range ranks after any data or scale change. A missing cell breaks the complete-block design and calls for another method or a justified data strategy. If ranges are driven by known measurement artifacts, address their source rather than adjusting weights after inspecting the p-value.
Sensitivity and robustness
An extreme reading can inflate a block's apparent informativeness, which is a different sensitivity from Friedman testing. Tied ranges, constant blocks, and few blocks affect score variation and F approximation. The method assumes independently replicated blocks and an interpretable quantitative range; ordinal coding alone does not automatically provide that scale.
How to use and calibrate
Use Fk−1,(b−1)(k−1) approximately, or a within block permutation distribution.
Example application
Compare treatments when blocks with wider response separation plausibly carry more information.
Interpretation and pitfalls
Watch out
Range weighting can amplify extreme measurements. Equal ranks and ties need the implementation’s corrections.
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.
Not run — Executed end to end through Rscript · needs Python standard library + Rscript; R packages: base R
# 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)
print(quade.test(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()
Validated — Executed successfully in the validation environment · needs Base/standard library
set.seed(2026)
b <- matrix(rnorm(36)+rep(c(0,.3,.7),each=12),nrow=12,ncol=3)
print(quade.test(b))
Output
Quade test data: b Quade F = 10.955, num df = 2, denom df = 22, p-value = 0.0004994
Sources
- R stats — R stats · quade.teststat.ethz.ch
- quade.teststat.ethz.ch
- Statistics guide v4 (historical):
- Python: Executed end to end through Rscript · R: Executed successfully in the validation 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 035, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT035.