Skip to content

ADescribe · Guide test 265

Mardia–Watson–Wheeler test

A rank based test comparing two or more circular distributions; also called Watson–Wheeler.

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 Comparing directions between groups (Watson–Williams, U², Wheeler, Wallraff, Rao), choose Test = Mardia–Watson–Wheeler (uniform scores).

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 · Mardia–Watson–Wheeler test

20
20
20
70
50
0.050

Your data

Drag a point or use ↑/↓ to change it
0°90°180°270°Group 1: n = 20, θ̄ = 42°, R̄ = 0.72Group 2: n = 20, θ̄ = 61°, R̄ = 0.68

Sectors are area-proportional counts; the arrows point to each mean direction, with length R̄ (0: no preferred direction, 1: all identical).

If H₀ were true

W = 3.50
  1. The reference: how W varies across samples when H₀ is true (χ² limit with 2(k − 1) df).
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .173).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

W=2∑g=1kCg2+Sg2ng,Cg=∑i∈gcos⁡2πRiN, Sg=∑i∈gsin⁡2πRiNW=2\sum_{g=1}^{k}\frac{C_g^2+S_g^2}{n_g},\quad C_g=\sum_{i\in g}\cos\frac{2\pi R_i}N,\ S_g=\sum_{i\in g}\sin\frac{2\pi R_i}N

With your numbers

W=3.50,n1=20, n2=20,ν=2W = 3.50,\quad n_1 = 20,\ n_2 = 20,\quad \nu = 2
RiR_i
circular rank of each direction in the pooled sample
2πRi/N2\pi R_i/N
uniform scores: ranks spaced evenly around the circle
χ2(k−1)2\chi^2_{2(k-1)}
the large-sample reference drawn

The verdict

W(2) = 3.50, p = .173

p > α = .050: compatible with H₀

A rank test, so it needs no von Mises assumption; ties and small groups make the χ² approximation rough.

Statistic
3.504
p-value
0.1734
Mardia–Watson–Wheeler test on Group 1 (°): n = 20; Group 2 (°): n = 20: W(2) = 3.50, p = .173. The p-value is above α = .050, so the data are compatible with H0.

Mardia–Watson–Wheeler test on Group 1 (°): n = 20; Group 2 (°): n = 20: W(2) = 3.50, p = .173. The p-value is above α = .050, so the data are compatible with H₀.

Question and hypotheses

H0: k independent circular distributions are equal.

Assumptions

Independent angular observations with a clear radians/degrees convention and orientation. The usual null uses a full circular domain; axial data require an appropriate doubling transformation or axial model. Continuous angles for the standard rank calibration; adequate group sizes for chi square approximation.

Formula

W=2∑g=1kCg2+Sg2ngCg=∑i∈gcos⁡(2πRi/N)Sg=∑i∈gsin⁡(2πRi/N)\begin{gathered}W=2\sum_{g=1}^{k}\frac{C_g^2+S_g^2}{n_g}\\[5pt] C_g=\sum_{i\in g}\cos(2\pi R_i/N)\\[5pt] S_g=\sum_{i\in g}\sin(2\pi R_i/N)\end{gathered}

Parameters and notation

Ri are pooled angular ranks around the circle; use documented tie and finite sample correction when needed.

Structure of the method

Pool all angular observations, replace their circular ranks by sine/cosine uniform scores, aggregate both score components within each group, and form the omnibus quadratic statistic. The chi-square reference has 2(k−1) degrees of freedom; an exchangeable-label permutation procedure must recompute the pooled statistic.

Estimated and nuisance parameters

No von Mises concentration or mean-direction model is fitted. Estimated quantities are ranks and group score sums; sample sizes determine the scaling. Angular origin, orientation and unit conversion are data conventions, not learned parameters.

Settings and design choices

Choose groups and the scientific comparison before viewing significance. State handling of ties, axial doubling and missing values. The circular documentation recommends at least ten observations per group for its chi-square approximation; this is implementation guidance rather than a universal sufficiency guarantee.

Fitting and adaptation

There is no neural fine-tuning. For a new study, recheck circular encoding and use the same prespecified score/ranking construction. If resampling is appropriate, calibrate under a null that preserves the actual sampling units and exchangeability, not by independently shuffling repeated measurements.

Sensitivity and robustness

Inspect group sizes, angular resolution and multimodality. Heavy ties weaken continuous-rank calibration, and repeated observations from the same animal or instrument require dependence-aware treatment. Rejection can reflect location or dispersion differences; identify the scientific source with plots and separately planned follow-up comparisons.

How to use and calibrate

Use χ²2(k−1) approximately or group label permutations.

Example application

Compare circular distributions without assuming equal-concentration von Mises forms.

Interpretation and pitfalls

Watch out

This is an omnibus distribution test; rejection cannot be attributed solely to mean direction.

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

Two independent circular samples. Watson–Williams is a common-concentration von Mises mean-direction test; rank/distributional alternatives answer different questions. Synthetic kappa=4 provides a reasonably concentrated example.

Python · invokes R

Not run — Executed end to end through Rscript · needs Python standard library + Rscript; R packages: circular

# 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)
a<-circular::rvonmises(40,circular::circular(0),kappa=4);b<-circular::rvonmises(40,circular::circular(.3),kappa=4)
print(circular::watson.wheeler.test(list(a,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 circular

set.seed(2026)
a<-circular::rvonmises(40,circular::circular(0),kappa=4);b<-circular::rvonmises(40,circular::circular(.3),kappa=4)
print(circular::watson.wheeler.test(list(a,b)))
Output
	Watson-Wheeler test for homogeneity of angles

data:  1 and 2
W = 4.5001, df = 2, p-value = 0.1054

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 265, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT265.