ADescribe · Guide test 265
Mardia–Watson–Wheeler test
A rank based test comparing two or more circular distributions; also called Watson–Wheeler.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Comparing directions between groups (Watson–Williams, U², Wheeler, Wallraff, Rao) — Do two or more groups differ in their typical direction, their spread, or the whole distribution of directions?
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
Your data
Drag a point or use ↑/↓ to change itSectors 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
- The reference: how W varies across samples when H₀ is true (χ² limit with 2(k − 1) df).
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .173).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- circular rank of each direction in the pooled sample
- uniform scores: ranks spaced evenly around the circle
- 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 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
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.
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()
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
- circular — circular · watson.wheeler.testAuthor documentation/source reviewed: circular 0.5-2.search.r-project.org
- watson.wheeler.testsearch.r-project.org
- circularsearch.r-project.org
- rvonmisessearch.r-project.org
- 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.