The MODEL Procedure

Testing for Normality

The NORMAL option in the FIT statement performs multivariate and univariate tests of normality.

The three multivariate tests provided are Mardia’s skewness test and kurtosis test (Mardia 1970) and the Henze-Zirkler upper T Subscript n comma beta test (Henze and Zirkler 1990). The two univariate tests provided are the Shapiro-Wilk W test and the Kolmogorov-Smirnov test. (For more information about the univariate tests, see the "Goodness-of-Fit Tests" section of the "The UNIVARIATE Procedure" chapter in the Base SAS Procedures Guide.) The null hypothesis for all these tests is that the residuals are normally distributed.

For a random sample upper X 1 comma ellipsis comma upper X Subscript n Baseline, upper X Subscript i Baseline element-of normal upper R Superscript d, where d is the dimension of upper X Subscript i and n is the number of observations, a measure of multivariate skewness is

where S is the sample covariance matrix of X. For weighted regression, both S and left-parenthesis upper X Subscript i Baseline minus mu right-parenthesis are computed by using the weights supplied by the WEIGHT statement or the _WEIGHT_ variable.

Mardia showed that under the null hypothesis StartFraction n Over 6 EndFraction b Subscript 1 comma d is asymptotically distributed as chi squared left-parenthesis d left-parenthesis d plus 1 right-parenthesis left-parenthesis d plus 2 right-parenthesis slash 6 right-parenthesis. For small samples, Mardia’s skewness test statistic is calculated with a small sample correction formula, given by StartFraction n k Over 6 EndFraction b Subscript 1 comma d where the correction factor k is given by k equals left-parenthesis d plus 1 right-parenthesis left-parenthesis n plus 1 right-parenthesis left-parenthesis n plus 3 right-parenthesis slash n left-parenthesis left-parenthesis left-parenthesis n plus 1 right-parenthesis left-parenthesis d plus 1 right-parenthesis right-parenthesis minus 6 right-parenthesis. Mardia’s skewness test statistic in PROC MODEL uses this small sample corrected formula.

A measure of multivariate kurtosis is given by

Mardia showed that under the null hypothesis, b Subscript 2 comma d is asymptotically normally distributed with mean d left-parenthesis d plus 2 right-parenthesis and variance 8 d left-parenthesis d plus 2 right-parenthesis slash n.

The Henze-Zirkler test is based on a nonnegative functional upper D left-parenthesis period comma period right-parenthesis that measures the distance between two distribution functions and has the property that

if and only if

where normal upper N Subscript d Baseline left-parenthesis mu comma normal upper Sigma Subscript d Baseline right-parenthesis is a d-dimensional normal distribution.

The distance measure upper D left-parenthesis period comma period right-parenthesis can be written as

where ModifyingAbove upper P With caret left-parenthesis t right-parenthesis and ModifyingAbove upper Q With caret left-parenthesis t right-parenthesis are the Fourier transforms of P and Q, and phi Subscript beta Baseline left-parenthesis t right-parenthesis is a weight or a kernel function. The density of the normal distribution normal upper N Subscript d Baseline left-parenthesis 0 comma beta squared upper I Subscript d Baseline right-parenthesis is used as phi Subscript beta Baseline left-parenthesis t right-parenthesis

where StartAbsoluteValue t EndAbsoluteValue equals left-parenthesis t Superscript prime Baseline t right-parenthesis Superscript 0.5.

The parameter beta depends on n as

The test statistic computed is called upper T Subscript beta Baseline left-parenthesis d right-parenthesis and is approximately distributed as a lognormal. The lognormal distribution is used to compute the null hypothesis probability,

where

Monte Carlo simulations suggest that upper T Subscript beta Baseline left-parenthesis d right-parenthesis has good power against distributions with heavy tails.

The Shapiro-Wilk W test is computed only when the number of observations (n) is less than 2,000, while computation of the Kolmogorov-Smirnov test statistic requires at least 2,000 observations.

The following is an example of the output produced by the NORMAL option:


proc model data=test2;
   y1 = a1 * x2 * x2 - exp( d1*x1);
   y2 = a2 * x1 * x1 + b2 * exp( d2*x2);
   fit y1 y2 / normal ;
run;

Figure 40: Normality Test Output

The MODEL Procedure

Normality Test
EquationTest StatisticValueProb
y1Shapiro-Wilk W0.34<.0001
y2Shapiro-Wilk W0.82<.0001
SystemMardia Skewness286.4<.0001
 Mardia Kurtosis31.28<.0001
 Henze-Zirkler T6.65<.0001


Last updated: August 11, 2020