Skip to content

ADescribe · Guide test 264

Watson–Williams test

Compares mean directions under von Mises distribution and compatible concentration assumptions.

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 = Watson–Williams (mean direction).

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

20
20
60
110
50
0.050

Your data

Drag a point or use ↑/↓ to change it
Group 1 (°) · n = 20 · mean direction 61°Group 2 (°) · n = 20 · mean direction 121°

If H₀ were true

F = 8.29
  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 = .006).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

F=K (N−k)(∑jRj−R)(k−1)(N−∑jRj),K=1+38κ^,  κ^=A1−1(R/N)F = K\,\dfrac{(N-k)\left(\sum_j R_j-R\right)}{(k-1)\left(N-\sum_j R_j\right)},\qquad K = 1+\dfrac{3}{8\hat\kappa},\ \ \hat\kappa = A_1^{-1}(R/N)

With your numbers

F=8.29,κ^=1.08F = 8.29,\quad \hat\kappa = 1.08
Rj, RR_j,\ R
resultant lengths of each group and of the pooled sample
κ^\hat\kappa
von Mises concentration (maximum likelihood, pooled sample)
KK
Stephens' correction factor

The verdict

F(1, 38) = 8.29, p = .006

p ≤ α = .050: reject H₀

The circular one-way ANOVA: assumes von Mises data with a common, not too small concentration.

Statistic
8.295
p-value
0.0065
Watson–Williams test on Group 1 (°): n = 20; Group 2 (°): n = 20: F(1, 38) = 8.29, p = .006. The p-value is below α = .050, so the data are hard to reconcile with H0.

Watson–Williams test on Group 1 (°): n = 20; Group 2 (°): n = 20: F(1, 38) = 8.29, p = .006. The p-value is below α = .050, so the data are hard to reconcile with H₀.

Question and hypotheses

H0: k circular populations have equal mean direction.

Assumptions

Independent von Mises samples with a common sufficiently large concentration parameter κ; adequate sample sizes.

Formula

F=(1+38κ^)(N−k)(∑jRj−R)(k−1)(N−∑jRj)F=\left(1+\frac3{8\widehat\kappa}\right)\frac{(N-k)(\sum_jR_j-R)}{(k-1)(N-\sum_jR_j)}

Parameters and notation

Rj is the length of group j’s resultant vector; R is pooled resultant length; κ̂ is pooled within-group concentration estimate.

Structure of the method

Compute each group’s resultant length and the pooled resultant, contrast within-group concentration with pooled alignment, and scale by the Watson–Williams finite-concentration correction before using the approximate F reference. This is a circular parametric mean-direction comparison under a shared-concentration model, not linear ANOVA on numeric angles.

Estimated and nuisance parameters

Estimate group mean directions, resultant lengths, and a common within-group concentration parameter. The pooled concentration estimate enters the approximation; it is not a tunable regularization constant. Unequal concentrations can confound a nominal mean-direction comparison, especially with unequal group sample sizes.

Settings and design choices

Choose groups, circular/axial representation, supported concentration regime, and exact implementation of the concentration correction. The simple 1+3/(8*kappa) expression is a high-concentration approximation; implementations may use regime-specific corrections. Check package warnings rather than suppressing them or interpreting every returned F value as equally reliable.

Fitting and adaptation

Fit the common-concentration von Mises framework or verify its suitability before reporting the F approximation. If it is unsuitable, select a mean-focused robust/circular alternative or a carefully justified model-based bootstrap; an unrestricted label permutation tests a stronger distributional-exchangeability null unless additional arguments justify it.

Sensitivity and robustness

Inspect concentration heterogeneity, low concentration, multimodality, outlying bearings, group imbalance, and subject dependence. A circular mean can be unstable when resultant length is small. Report estimated directions with circular uncertainty intervals, and do not treat nonrejection as equivalence or assume an omnibus distribution test answers the same question.

How to use and calibrate

Use approximate Fk−1,N−k after checking the concentration regime and equal-concentration assumption.

Example application

Compare average orientation among experimental groups.

Interpretation and pitfalls

Watch out

Low concentration, multimodality or unequal κ can invalidate the F approximation; ordinary linear ANOVA on raw angles is also inappropriate.

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.williams.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.williams.test(list(a,b)))
Output
	Watson-Williams test for homogeneity of means

data:  1 and 2
F = 8.5811, df1 = 1, df2 = 78, p-value = 0.004452
sample estimates:
Circular Data: 
Type = angles 
Units = radians 
Template = none 
Modulo = asis 
Zero = 0 
Rotation = counter 
  mean of 1   mean of 2 
-0.07722554  0.27231451

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