Skip to content

BCompare groups · Guide test 023

Fligner–Policello test

Provides a robust rank based two sample location comparison under its distributional assumptions.

Runs in CodeSplashPython example validatedR example validated

Do it in CodeSplash

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

In Brunner–Munzel test (stochastic equality), choose Test = Fligner–Policello (robust rank-order).

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 · Fligner–Policello test

20
20
0.50
1.0
2.2
0.050

Alternative

Your data

Drag a point or use ↑/↓ to change it
Group 1 · n = 20 · mean 0.86Group 2 · n = 20 · mean −0.32

If H₀ were true

z = 2.44
  1. The reference: how z 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 = .015).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

z=∑iPi−∑jQj2VP+VQ+PˉQˉz = \dfrac{\sum_i P_i-\sum_j Q_j}{2\sqrt{V_P+V_Q+\bar P\bar Q}}

With your numbers

z=2.44z = 2.44
PiP_i
number of y below xᵢ (placements)
QjQ_j
number of x below yⱼ
VP, VQV_P,\ V_Q
sums of squared deviations of the placements

The verdict

z = 2.44, p = .015

p ≤ α = .050: reject H₀

A robust rank-order test for the Behrens–Fisher problem: assumes symmetry, not equal spreads.

Statistic
2.441
p-value
0.0146
Fligner–Policello test on Group 1: n = 20; Group 2: n = 20: z = 2.44, p = .015. The p-value is below α = .050, so the data are hard to reconcile with H0.

Fligner–Policello test on Group 1: n = 20; Group 2: n = 20: z = 2.44, p = .015. The p-value is below α = .050, so the data are hard to reconcile with H₀.

Question and hypotheses

H0: two symmetric population locations are equal; H1: they differ.

Assumptions

Independent continuous samples, symmetric distributions for the location interpretation; scales may differ. Ties require a documented extension.

Formula

T=mPˉ−nQˉ2sP2+sQ2+PˉQˉT=\frac{m\bar P-n\bar Q}{2\sqrt{s_P^2+s_Q^2+\bar P\bar Q}}

Parameters and notation

Pi is the number of Y observations below Xi; Qj the number of X observations below Yj. P̄,Q̄ are their means; sP²=Σ(Pi−P̄)² and sQ²=Σ(Qj−Q̄)² are unnormalized squared deviations.

Structure of the method

For each observation, count observations from the other sample below it; combine the resulting placements into the Fligner–Policello standardized statistic. The denominator includes within-sample placement dispersion and a finite correction term. Its displayed normal-tail calculation is an asymptotic implementation; finite critical-value routines may use a different calibration route.

Estimated and nuisance parameters

Estimated quantities are placement means and their unnormalized sums of squared deviations. No common raw-data variance is assumed. The symmetric population locations are the interpretation target; symmetry is a substantive distributional condition rather than a parameter fitted by the rank calculation or verified by a nonsignificant symmetry pretest.

Settings and design choices

Specify sample order, direction, normal versus tabulated/simulated calibration, tie treatment, alpha, and any multiplicity adjustment. The baseline custom snippets generate continuous normal samples and therefore avoid ties deliberately. Applying the same strict-inequality code to rounded ordinal data without a documented tie extension changes the method's justification.

Fitting and adaptation

Recompute placements after any filtering or regrouping. To study robustness, simulate symmetric equal-location distributions with the planned unequal scales and sample sizes, then repeat the complete statistic. Such a calibration is conditional on that scenario; switching to asymmetric data changes the interpretation and may require a different relative-effect procedure.

Sensitivity and robustness

Very small samples can make normal approximation inaccurate, and degenerate placement spreads can cause numerical instability. Symmetric heavy tails may be compatible with the intended location model, while asymmetry can make equal medians insufficient. Preserve statistic orientation across languages before reporting a one-sided conclusion.

How to use and calibrate

The displayed Fligner–Policello form uses the large sample standard normal reference; use documented finite sample critical values where available.

Example application

Compare symmetric measurements from two instruments with different precision.

Interpretation and pitfalls

Watch out

Symmetry is essential for interpreting location; this is not a universally assumption free substitute for Welch. Software may reverse the statistic sign.

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

Direct Fligner–Policello formula with large-sample normal calibration and continuous, untied observations. Symmetry is needed for a location interpretation; this is not a universally assumption-free Welch replacement.

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)
x=rng.normal(size=40);y=rng.normal(.3,1.4,45)
P=(x[:,None]>y[None,:]).sum(1);Q=(y[:,None]>x[None,:]).sum(1);m=len(x);n=len(y)
T=(m*P.mean()-n*Q.mean())/(2*np.sqrt(np.sum((P-P.mean())**2)+np.sum((Q-Q.mean())**2)+P.mean()*Q.mean()))
print(T,2*stats.norm.sf(abs(T)))
Output
-1.0609690875121387 0.2887039497999617
R

Validated — Executed successfully in the validation environment · needs Base/standard library

set.seed(2026)
x<-rnorm(40);y<-rnorm(45,.3,1.4)
P<-rowSums(outer(x,y,">"));Q<-rowSums(outer(y,x,">"));m<-length(x);n<-length(y)
T<-(m*mean(P)-n*mean(Q))/(2*sqrt(sum((P-mean(P))^2)+sum((Q-mean(Q))^2)+mean(P)*mean(Q)))
print(c(statistic=T,p=2*pnorm(-abs(T))))
Output
  statistic           p 
-0.05154769  0.95888910

Sources

Statistics guide v4 (historical):
R: Executed successfully in the validation 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 023, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT023.