BCompare groups · Guide test 165
Royston multivariate normality test
Combines transformed marginal normality statistics while accounting for correlations.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Multivariate normality tests — Do several variables jointly follow a multivariate normal distribution?
In Multivariate normality tests, choose Test = Royston.
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 · Royston multivariate normality test
0 is symmetric.
Below 1: heavier tails than normal.
Your data
Simulated with a known ρIf H₀ were true
- The reference: how H varies across samples when H₀ is true (χ² approximation).
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .085).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- Royston's normalizing transform of margin j's Shapiro–Wilk W (Shapiro–Francia W′ when that margin's kurtosis exceeds 3)
- equivalent degrees of freedom (ν in the guide's formula): between 1 and p, smaller when the margins are correlated
The verdict
H(2.00) = 4.93, p = .085
p > α = .050: compatible with H₀
Royston's test only looks at the margins, so a non-normal joint shape with normal margins passes it.
- Statistic
- 4.927
- p-value
- 0.0852
Royston multivariate normality test on 40 (x, y) pairs: H(2.00) = 4.93, p = .085. The p-value is above α = .050, so the data are compatible with H₀.
Question and hypotheses
H0: multivariate normality, assessed through correlated marginal normality statistics.
Assumptions
Independent identically distributed p-dimensional observations; positive definite covariance and sufficient n relative to p. The null is a multivariate normal distribution with unknown mean/covariance. The cited implementation supports 4≤n≤2000.
Formula
Parameters and notation
is a Royston-calibrated marginal W p value (Shapiro–Wilk, or Shapiro–Francia in the specified heavy-tail variant). For it is with , where and are Royston’s polynomial mean and standard deviation of ; for Royston (1992) uses a separate transformation of W. c̄ averages transformed off-diagonal correlations c(r)=r⁵[1−0.715(1−r)^0.715/v], v=0.21364+0.015124(log n)²−0.0018034(log n)³. The implementation’s W transformations must match this adjustment.
Structure of the method
Apply the specified Shapiro–Wilk/Shapiro–Francia-based marginal procedure, transform each coordinate's evidence, and adjust the combined statistic for dependence between coordinates. The effective degrees of freedom arise from the correlation correction. This is a marginal-statistic combination, not a fully affine-invariant joint-distance test.
Estimated and nuisance parameters
Marginal normality summaries, sample correlations, and their transformation-dependent effective degrees of freedom are estimated. Location/scale are absorbed into the component statistics; the estimated correlation correction is not an independently tuned neural parameter.
Settings and design choices
Fix the supported sample-size range, marginal-test selection rule, covariance/correlation conventions, and missing-value policy. Arbitrary marginal p-values cannot be inserted into the Royston formula because its transformation and dependence calibration are specific to the component construction.
Fitting and adaptation
Use the complete documented algorithm on the final analysis matrix. When calibrating by fitted-normal simulation, repeat the marginal-test choice, transforms, correlations, and aggregation for each replicate. If variables were selected after inspecting marginal failures, account for that selection or use a fresh validation sample.
Sensitivity and robustness
Normal marginals can coexist with a nonnormal dependence structure that this approach misses. Correlation extremes, small n, unsupported sample sizes, ties and near-constant variables can compromise approximations. Rotation can change the result, so interpret it for the measured coordinates and complement it with joint diagnostics rather than claiming invariant evidence about every representation of the data.
How to use and calibrate
Use χ²ν approximately or a fitted multivariate normal bootstrap repeating the full marginal selection/calibration rule.
Example application
Combine evidence of marginal departures while accounting approximately for correlation.
Interpretation and pitfalls
Watch out
Marginal normality does not imply joint normality. Royston is not affine invariant and may miss dependence-only departures; do not substitute arbitrary marginal p values into its calibration.
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.
- Rewritten in the review: parameters and notation.
- Not in the correction log: Edition 2's Parameters field regressed (raw TeX without $$, drops v4's c(r) transform and v constants, covers only n ≥ 12); the Academy merges v4 and edition 2 (academy/import/corrections/edition2.yaml).
Python and R
Current MVN function interface. Mardia prints skewness and kurtosis components together: use the component named in this entry. Covariance must be estimable and observations independent.
Not run — Python launcher syntax checked; R backend runtime not verified · needs Python standard library + Rscript; R packages: MVN
# 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)
X<-matrix(rnorm(120),ncol=3);Y<-matrix(rnorm(150,mean=.3),ncol=3)
print(MVN::royston(X))
"""
# 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()
Not run — Syntax checked; runtime not verified in the final environment · needs MVN
set.seed(2026)
X<-matrix(rnorm(120),ncol=3);Y<-matrix(rnorm(150,mean=.3),ncol=3)
print(MVN::royston(X))
Sources
- MVN — MVN · roystonAuthor documentation/source reviewed: MVN 6.3.rdrr.io
- roystonrdrr.io
- roystonsearch.r-project.org
- Statistics guide v4 (historical):
- Python: Python launcher syntax checked; R backend runtime not verified · R: Syntax checked; runtime not verified in the final 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 165, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT165.