Omnibus test for univariate or multivariate normality
omninorm varlist [if exp] [in range] [, allobs by(byvar) missing marginals ]
by ... : may also be used with omninorm: see help on by. varlist may contain time-series operators; see help on varlist.
omninorm performs an omnibus test for normality on one or several variables proposed by Doornik and Hansen (1994, 2008), itself based on a test by Shenton and Bowman (1977). The test statistic is based on transformations of skewness and kurtosis that are much closer to standard normal than the raw moment measures. The test may be applied to a set of variables, such as the residuals from a multivariate regression. Doornik and Hansen conducted simulations that illustrate that this test will generally have better size and power than several proposed in the literature, including the multivariate Shapiro-Wilk test of Royston (1983). They find that their omnibus test "is simple, has correct size and good power properties" (Doornik and Hansen 2008, p.936).
Under the null hypothesis of normality of the specified k variables, the test statistic is distributed chi-squared with 2 k degrees of freedom. An asymptotic form of the test is also provided, which is essentially a multivariate equivalent of the Bowman and Shenton (1975) test, which those authors consider "unsuitable, except in very large samples" (Doornik and Hansen 2008, p.928).
allobs specifies use of the maximum possible number of observations for each variable. The default is to use only those observations for which all variables in varlist are not missing. This option bites only if marginals is also specified.
by() specifies a variable defining distinct groups for which statistics should be calculated. by() is allowed only with a single byvar. The choice between by: and by() is partly one of precisely what kind of output display is required. The display with by: is clearly structured by groups while that with by() is more compact. To show statistics for the marginal distributions of several variables and several groups with a single call to omninorm, the display with by: is essential.
marginals specifies that whenever several variables are specified, univariate (i.e. marginal) tests are to be carried out for each.
missing specifies that with the by() option observations with missing values of byvar should be included in calculations. The default is to exclude them.
. use http://fmwww.bc.edu/ec-p/data/micro/iris,clear . omninorm set_sepl set_sepw set_petw set_petl . omninorm set_sepl set_sepw set_petw set_petl, marginals
Citation of omninorm
omninorm is not an official Stata command. It is a free contribution to the research community, like a paper. Please cite it as such:
Baum, C.F., Cox, N.J. 2007. omninorm: Stata module to calculate omnibus test for univariate/multivariate normality. http://ideas.repec.org/c/boc/bocode/s417501.html
We are grateful to William Gould for assistance with Mata programming.
Christopher F. Baum, Boston College, USA firstname.lastname@example.org
Nicholas J. Cox, Durham University, U.K. email@example.com
Bowman, K.O. and Shenton, L.R. 1975. Omnibus test contours for departures from normality based on root-b1 and b2. Biometrika 62: 243-250.
Doornik, Jurgen A. and Hansen, Henrik. 1994. An omnibus test for univariate and multivariate normality. Working Paper, Nuffield College, University of Oxford. See http://ideas.repec.org/p/nuf/econwp/9604.html or http://www.doornik.com/research/normal2.pdf
Doornik, Jurgen A. and Hansen, Henrik. 2008. An omnibus test for univariate and multivariate normality. Oxford Bulletin of Economics and Statistics 70: 927-939.
Royston, J.P. 1983. Some techniques for assessing multivariate normality based on the Shapiro-Wilk W. Applied Statistics 32: 121-133.
Shenton, L.R. and Bowman, K.O. 1977. A bivariate model for the distribution of root-b1 and b2. Journal of the American Statistical Association 72: 206-211.
(for last-named variable or group only)
r(df) degrees of freedom of test r(k) number of variables in test r(dhansen) Doornik-Hansen test statistic r(p_dhansen) P-value of above r(asy) asymptotic test statistic r(p_asy) P-value of above
Online: sktest, swilk