BCompare groups · Guide test 166
Doornik–Hansen test
Tests multivariate normality through transformed skewness and kurtosis measures.
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 = Doornik–Hansen.
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 · Doornik–Hansen test
0 is symmetric.
Below 1: heavier tails than normal.
Your data
Simulated with a known ρIf H₀ were true
- The reference: how E 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 = .005).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- transformed skewness of component j
- transformed kurtosis, adjusted for the skewness
- number of variables
The verdict
E(4) = 15.09, p = .005
p ≤ α = .050: reject H₀
Works on the components C^(−½)·(standardized data), so it is affine invariant; the skewness-dependent kurtosis transform keeps the χ² approximation good in small samples.
- Statistic
- 15.088
- p-value
- 0.0045
Doornik–Hansen test on 40 (x, y) pairs: E(4) = 15.09, p = .005. The p-value is below α = .050, so the data are hard to reconcile with H₀.
Question and hypotheses
H0: multivariate normality through decorrelated skewness and kurtosis.
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
Whiten standardized data using the inverse square root of its correlation matrix. For each transformed coordinate calculate skewness bj and kurtosis kj; Z1j is entry 112’s transformation. Let d=(n−3)(n+1)(n²+15n−4), a=(n−2)(n+5)(n+7)(n²+27n−70)/(6d), c=(n−7)(n+5)(n+7)(n²+2n−5)/(6d), h=(n+5)(n+7)(n³+37n²+11n−313)/(12d); αj=a+cbj², χj=2h(kj−1−bj²).
Structure of the method
Standardize coordinates, decorrelate them using an inverse square-root correlation transformation, then compute transformed skewness and skewness-adjusted kurtosis contributions. Their squared sum forms the omnibus statistic. The whitening and finite-sample moment transforms are essential; summing ordinary Jarque–Bera values on correlated raw variables is not equivalent.
Estimated and nuisance parameters
Marginal scales, the correlation matrix, transformed-coordinate skewness/kurtosis, and finite-sample transformation quantities are estimated. The normal reference has 2p nominal degrees of freedom in the stated full-rank asymptotic formulation; this is not a user-selected model width.
Settings and design choices
Specify numerical eigenvalue handling, sample-size restrictions, missing values, covariance conventions, and asymptotic versus simulated calibration. Trimming or winsorizing outliers changes the hypothesis about the original distribution and should not be an unreported tuning operation.
Fitting and adaptation
Apply the normality diagnostic after the scientific variables and preprocessing have been fixed. For bootstrap calibration, regenerate under the fitted multivariate-normal null and repeat standardization, decorrelation, and moment transformations. Fitted regression residuals require a simulation that also refits the regression if its estimation affects the reference.
Sensitivity and robustness
Check singularity, extreme correlations, heavy tails, and influential points. Finite-sample transforms improve moment approximations but do not make the statistic robust to arbitrary dependence, missing-data mechanisms, or high-dimensional singularity. Rejection indicates a departure detected by this transformed moment construction, not a uniquely identified skewness mechanism.
How to use and calibrate
Use the upper χ²2p tail or refitted normal bootstrap. The skewness-dependent kurtosis transformation is essential.
Example application
Evaluate multivariate normality with a transformed moment omnibus statistic.
Interpretation and pitfalls
Watch out
Simply summing univariate Jarque–Bera tests on raw correlated columns is not Doornik–Hansen.
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::doornik_hansen(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::doornik_hansen(X))
Sources
- MVN — MVN · doornik_hansenAuthor documentation/source reviewed: MVN 6.3.rdrr.io
- doornik_hansenrdrr.io
- doornik_hansensearch.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 166, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT166.