RSK Test
RSK Test
stata.com
sktest Skewness and kurtosis test for normality
Syntax
Remarks and examples
References
Menu
Stored results
Also see
Description
Methods and formulas
Option
Acknowledgments
Syntax
sktest varlist if
in
weight
, noadjust
aweights and fweights are allowed; see [U] 11.1.6 weight.
Menu
Statistics
>
>
>
Description
For each variable in varlist, sktest presents a test for normality based on skewness and another
based on kurtosis and then combines the two tests into an overall test statistic. sktest requires a
minimum of 8 observations to make its calculations. See [MV] mvtest normality for multivariate
tests of normality.
Option
Main
noadjust suppresses the empirical adjustment made by Royston (1991c) to the overall 2 and
its significance level and presents the unaltered test as described by DAgostino, Belanger, and
DAgostino (1990).
stata.com
Also see [R] swilk for the Shapiro Wilk and Shapiro Francia tests for normality. Those tests are,
in general, preferred for nonaggregated data (Gould and Rogers 1991; Gould 1992; Royston 1991c).
Moreover, a normal quantile plot should be used with any test for normality; see [R] diagnostic plots
for more information.
Example 1
Using our automobile dataset, we will test whether the variables mpg and trunk are normally
distributed:
. use http://www.stata-press.com/data/r13/auto
(1978 Automobile Data)
. sktest mpg trunk
Skewness/Kurtosis tests for Normality
Variable
Obs
Pr(Skewness)
Pr(Kurtosis)
adj chi2(2)
mpg
trunk
74
74
0.0015
0.9115
0.0804
0.0445
10.95
4.19
joint
Prob>chi2
0.0042
0.1228
We can reject the hypothesis that mpg is normally distributed, but we cannot reject the hypothesis
that trunk is normally distributed, at least at the 12% level. The kurtosis for trunk is 2.19, as can
be verified by issuing the command
. summarize trunk, detail
(output omitted )
and the p-value of 0.0445 shown in the table above indicates that it is significantly different from
the kurtosis of a normal distribution at the 5% significance level. However, on the basis of skewness
alone, we cannot reject the hypothesis that trunk is normally distributed.
Technical note
sktest implements the test as described by DAgostino, Belanger, and DAgostino (1990) but with
the adjustment made by Royston (1991c). In the above example, if we had specified the noadjust
option, the 2 values would have been 13.13 for mpg and 4.05 for trunk. With the adjustment, the
2 value might show as .. This result should be interpreted as an absurdly large number; the data
are most certainly not normal.
Stored results
sktest stores the following in r():
Scalars
r(chi2)
r(P skew)
r(P kurt)
r(P chi2)
Matrices
r(N)
r(Utest)
Pr(skewness)
Pr(kurtosis)
Prob > chi2
matrix of observations
matrix of test results, one row per variable
1/2
(n + 1)(n + 3)
6(n 2)
2
3(n + 27n 70)(n + 1)(n + 3)
2 (g1 ) =
(n 2)(n + 5)(n + 7)(n + 9)
Y = g1
and
W 2 = 1 + [2 {2 (g1 ) 1}]
1/2
= 2/(W 2 1)
1/2
Z1 =
h
1/2 i
1
ln Y / + (Y /)2 + 1
lnW
is approximately standard normal under the null hypothesis that the data are distributed normally.
To perform the test of kurtosis, we compute
3(n 1)
n+1
24n(n 2)(n 3)
var(b2 ) =
(n + 1)2 (n + 3)(n + 5)
p
X = {b2 E(b2 )} / var(b2 )
1/2
p
6(n2 5n + 2) 6(n + 3)(n + 5)
1 (b2 ) =
(n + 7)(n + 9) n(n 2)(n 3)
"
1/2 #
8
2
4
p
A=6+ p
+ 1+
1 (b2 )
1 (b2 )
1 (b2 )
E(b2 ) =
and
)1/3
(
1
2
1
2/A
1
Z2 = p
9A
2/(9A)
1 + X 2/(A 4)
is approximately standard normal under the null hypothesis that the data are distributed normally.
DAgostino, Balanger, and DAgostino Jr.s omnibus test of normality uses the statistic
K 2 = Z12 + Z22
which has approximately a 2 distribution with 2 degrees of freedom under the null of normality.
Royston (1991c) proposed the following adjustment to the test of normality, which sktest uses
by default. Let (x) denote the cumulative standard normal distribution function for x, and let
1 (p) denote the inverse cumulative standard normal function [that is, x = 1 {(x)}]. Define
the following terms:
Zc =
and
Zt
a1
b1
a2
b2
1
exp K 2
2
= 0.55n0.2 0.21
= (5 + 3.46 lnn) exp(1.37 lnn)
= 1 + (0.854 0.148 lnn) exp(0.55 lnn)
= a1 {2.13/(1 2.37 lnn)} Zt
= 2.13/(1 2.37 lnn) + b1
Acknowledgments
sktest has benefited greatly by the comments and work of Patrick Royston of the MRC Clinical
Trials Unit, London, and coauthor of the Stata Press book Flexible Parametric Survival Analysis
Using Stata: Beyond the Cox Model. At this point, the program should be viewed as due as much to
Royston as to us, except, of course, for any errors. We are also indebted to Nicholas J. Cox of the
Department of Geography at Durham University, UK, and coeditor of the Stata Journal for his helpful
comments.
References
DAgostino, R. B., A. J. Belanger, and R. B. DAgostino, Jr. 1990. A suggestion for using powerful and informative
tests of normality. American Statistician 44: 316321.
. 1991. sg3.3: Comment on tests of normality. Stata Technical Bulletin 3: 20. Reprinted in Stata Technical
Bulletin Reprints, vol. 1, pp. 105106. College Station, TX: Stata Press.
Gould, W. W. 1991. sg3: Skewness and kurtosis tests of normality. Stata Technical Bulletin 1: 2021. Reprinted in
Stata Technical Bulletin Reprints, vol. 1, pp. 99101. College Station, TX: Stata Press.
. 1992. sg11.1: Quantile regression with bootstrapped standard errors. Stata Technical Bulletin 9: 1921. Reprinted
in Stata Technical Bulletin Reprints, vol. 2, pp. 137139. College Station, TX: Stata Press.
Gould, W. W., and W. H. Rogers. 1991. sg3.4: Summary of tests of normality. Stata Technical Bulletin 3: 2023.
Reprinted in Stata Technical Bulletin Reprints, vol. 1, pp. 106110. College Station, TX: Stata Press.
Jarque, C. M., and A. K. Bera. 1987. A test for normality of observations and regression residuals. International
Statistical Review 2: 163172.
Marchenko, Y. V., and M. G. Genton. 2010. A suite of commands for fitting the skew-normal and skew-t models.
Stata Journal 10: 507539.
Royston, P. 1991a. sg3.1: Tests for departure from normality. Stata Technical Bulletin 2: 1617. Reprinted in Stata
Technical Bulletin Reprints, vol. 1, pp. 101104. College Station, TX: Stata Press.
. 1991b. sg3.2: ShapiroWilk and ShapiroFrancia tests. Stata Technical Bulletin 3: 19. Reprinted in Stata
Technical Bulletin Reprints, vol. 1, p. 105. College Station, TX: Stata Press.
. 1991c. sg3.5: Comment on sg3.4 and an improved DAgostino test. Stata Technical Bulletin 3: 2324. Reprinted
in Stata Technical Bulletin Reprints, vol. 1, pp. 110112. College Station, TX: Stata Press.
. 1991d. sg3.6: A response to sg3.3: Comment on tests of normality. Stata Technical Bulletin 4: 89. Reprinted
in Stata Technical Bulletin Reprints, vol. 1, pp. 112114. College Station, TX: Stata Press.
Also see
[R] diagnostic plots Distributional diagnostic plots
[R] ladder Ladder of powers
[R] lv Letter-value displays
[R] swilk Shapiro Wilk and Shapiro Francia tests for normality
[MV] mvtest normality Multivariate normality tests