Skip to content

BCompare groups · Guide test 161

Mardia multivariate skewness test

Tests whether multivariate skewness matches the multivariate normal model.

Runs in CodeSplashPython (calls R) example not runR example not run

Do it in CodeSplash

In the app, set it up in Analyze with this method:

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

40
0.00
0.00
0.40
0.70
0.050

Your data

Simulated with a known ρ

If H₀ were true

χ² = 18.13
  1. The reference: how χ² 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 = .001).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

b1,p=1n2∑i,j(zi⊤S−1zj)3,n b1,p6∼χp(p+1)(p+2)/62b_{1,p} = \dfrac{1}{n^2}\sum_{i,j}\left(\mathbf z_i^{\top}\mathbf S^{-1}\mathbf z_j\right)^3,\qquad \dfrac{n\,b_{1,p}}{6}\sim\chi^2_{p(p+1)(p+2)/6}

With your numbers

b1=2.72,χ2=18.13b_1 = 2.72,\quad \chi^2 = 18.13
zi\mathbf z_i
centered observation
S\mathbf S
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 H0.

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

b1,p=1n2∑ij[(xi−xˉ)TSn−1(xj−xˉ)]3b_{1,p}=\frac1{n^2}\sum_{ij}[(x_i-\bar x)^TS_n^{-1}(x_j-\bar x)]^3

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.

Python · invokes R

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()
R

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

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.