------------------------------------------------------------------------------- help foromninorm-------------------------------------------------------------------------------

Omnibus test for univariate or multivariate normality

omninormvarlist[ifexp] [inrange] [,allobsby(byvar)missingmarginals]

by ... :may also be used withomninorm: see help on by.varlistmay contain time-series operators; see help on varlist.

Description

omninormperforms 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).

Options

allobsspecifies use of the maximum possible number of observations for each variable. The default is to use only those observations for which all variables invarlistare not missing. This option bites only ifmarginalsis also specified.

by()specifies a variable defining distinct groups for which statistics should be calculated.by()is allowed only with a singlebyvar. The choice betweenby:andby()is partly one of precisely what kind of output display is required. The display withby:is clearly structured by groups while that withby()is more compact. To show statistics for the marginal distributions of several variables and several groups with a single call toomninorm, the display withby:is essential.

marginalsspecifies that whenever several variables are specified, univariate (i.e. marginal) tests are to be carried out for each.

missingspecifies that with theby()option observations with missing values ofbyvarshould be included in calculations. The default is to exclude them.

Examples. 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

omninormis 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

AcknowledgmentsWe are grateful to William Gould for assistance with Mata programming.

AuthorsChristopher F. Baum, Boston College, USA baum@bc.edu

Nicholas J. Cox, Durham University, U.K. n.j.cox@durham.ac.uk

ReferencesBowman, K.O. and Shenton, L.R. 1975. Omnibus test contours for departures from normality based on root-b1 and b2.

Biometrika62: 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 Economicsand Statistics70: 927-939.Royston, J.P. 1983. Some techniques for assessing multivariate normality based on the Shapiro-Wilk W.

Applied Statistics32: 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 StatisticalAssociation72: 206-211.

Saved results(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

Also seeOnline: sktest, swilk