BCompare groups · Guide test 161
Mardia multivariate skewness test
Tests whether multivariate skewness matches the multivariate normal model.
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 = Mardia skewness.
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 multivariate skewness test
Your data
Simulated with a known ρIf H₀ were true
- The reference: how χ² varies across samples when H₀ is true.
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .001).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- centered observation
- covariance (ML)
The verdict
χ²(4) = 18.13, p = .001
p ≤ α = .050: reject H₀
Multivariate normality fails if any combination is skewed; this checks all of them at once.
- Statistic
- 18.134
- p-value
- 0.0012
Mardia multivariate skewness test on 40 (x, y) pairs: χ²(4) = 18.13, p = .001. The p-value is below α = .050, so the data are hard to reconcile with H₀.
Question and hypotheses
H0: multivariate normality, assessed through third-order structure.
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.
Formula
Parameters and notation
Sn=n⁻¹Σ(xi−x̄)(xi−x̄)ᵀ; use the covariance normalization matching calibration.
Structure of the method
Center the n-by-p observation matrix, estimate covariance with the stated divisor, solve the covariance system, and form all standardized cross-products. Cubing and averaging those cross-products produces multivariate skewness. This is an affine-invariant moment statistic with a reference distribution, not a predictive network or trainable architecture.
Estimated and nuisance parameters
The sample mean vector and covariance matrix are fitted nuisance quantities. The skewness coefficient is an estimated distributional feature; n and p determine the nominal asymptotic degrees of freedom rather than being optimized parameters.
Settings and design choices
Specify included variables, covariance normalization, missing-data handling, inversion tolerance, small-sample correction, and asymptotic versus simulated calibration. None should be selected by repeatedly trying settings until normality is not rejected.
Fitting and adaptation
Fit location/covariance on the observations under examination. For a fitted-normal bootstrap, generate a complete null sample and repeat centering, covariance estimation, and the entire statistic for every replicate. A transformation chosen from these data requires its own selection-aware validation; it is not neural fine-tuning.
Sensitivity and robustness
Check n relative to p, covariance conditioning, leverage and influential observations. Cubic cross-products emphasize asymmetric outliers. Ordinary independent-sample calibration is inappropriate for correlated rows or fitted regression residuals without accounting for their estimation. Report skewness alongside plots and other scientifically motivated diagnostics; nonrejection cannot certify joint normality.
How to use and calibrate
Use nb1,p/6~χ²[p(p+1)(p+2)/6] asymptotically; apply a documented small sample correction if used.
Example application
Detect multivariate skewness invisible in some marginal summaries.
Interpretation and pitfalls
Watch out
Zero multivariate skewness does not imply multivariate normality. High dimensions impair the approximation.
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
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::mardia(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::mardia(X))
Sources
- MVN — MVN · mardiaAuthor documentation/source reviewed: MVN 6.3.rdrr.io
- mardiardrr.io
- mardiasearch.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 161, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT161.