Skip to content

BCompare groups · Guide test 035

Quade test

Compares treatments in complete blocks while weighting blocks by their observed response ranges.

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

Do it in CodeSplash

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

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

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

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

The formula

FQ=(b−1)BA−B,Sij=Qi(rij−k+12)F_Q = \dfrac{(b-1)B}{A-B},\quad S_{ij} = Q_i\left(r_{ij}-\tfrac{k+1}{2}\right)

With your numbers

FQ=1.65,ν1=3, ν2=27F_Q = 1.65,\quad \nu_1 = 3,\ \nu_2 = 27
QiQ_i
rank of block i's range
A=∑Sij2, B=1b∑j(∑iSij)2A = \sum S_{ij}^2,\ B = \frac{1}{b}\sum_j\left(\sum_i S_{ij}\right)^2
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 H0.

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

Sij=qi[Rij−(k+1)/2]A=∑ijSij2, B=b−1∑j(∑iSij)2F=(b−1)BA−B\begin{gathered}S_{ij}=q_i[R_{ij}-(k+1)/2]\\[5pt] A=\sum_{ij}S_{ij}^2,\ B=b^{-1}\sum_j(\sum_iS_{ij})^2\\[5pt] F=\frac{(b-1)B}{A-B}\end{gathered}

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.

Python · invokes R

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

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

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.