Beruflich Dokumente
Kultur Dokumente
Author(s): J. P. Royston
Source: Journal of the Royal Statistical Society. Series C (Applied Statistics), Vol. 31, No. 2
(1982), pp. 115-124
Published by: Blackwell Publishing for the Royal Statistical Society
Stable URL: http://www.jstor.org/stable/2347973
Accessed: 20/09/2010 03:57
Your use of the JSTOR archive indicates your acceptance of JSTOR's Terms and Conditions of Use, available at
http://www.jstor.org/page/info/about/policies/terms.jsp. JSTOR's Terms and Conditions of Use provides, in part, that unless
you have obtained prior permission, you may not download an entire issue of a journal or multiple copies of articles, and you
may use content in the JSTOR archive only for your personal, non-commercial use.
Please contact the publisher regarding any further use of this work. Publisher contact information may be obtained at
http://www.jstor.org/action/showPublisher?publisherCode=black.
Each copy of any part of a JSTOR transmission must contain the same copyright notice that appears on the screen or printed
page of such transmission.
JSTOR is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range of
content in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new forms
of scholarship. For more information about JSTOR, please contact support@jstor.org.
Royal Statistical Society and Blackwell Publishing are collaborating with JSTOR to digitize, preserve and
extend access to Journal of the Royal Statistical Society. Series C (Applied Statistics).
http://www.jstor.org
Appl.Statist.(1982),
31, No. 2, pp. 115-124
SUMMARY
Shapiroand Wilk's(1965) W statisticarguablyprovidesthe best omnibustestof
butis currently
normality, to samplesizesbetween
limited 3 and50.Wisextended up to
n = 2000 and an approximate normalizing transformation suitablefor computer
implementationis given.A novelapplication
ofWintransforming datato normality
is
usingthethree-parameter
suggested, lognormalas an example.
Keywords: TESTSOF NORMALITY;OMNIBUSTEST;W STATISTIC;NORMALIZING
TRANSFORMATION;
POLYNOMIALSMOOTHING
1. INTRODUCTION
RESEARCHinto tests of non-normalitywas given new impetus with the introduction of the so-
calledanalysisofvariancetestbyShapiroand Wilk(1965).The teststatisticWwasconstructed
by consideringthe regressionof orderedsample values on correspondingexpectednormal
orderstatistics,
whichfora samplefroma normallydistributedpopulationis linear;Wwas
obtained as an F-ratio from generalized least-squares analysis to judge the adequacy of the
linear fit.Percentage points of the null distributionof Wwere tabulated forp = 0 01, 002, 005,
0 1, 0 5, 0-9,0 95, 0 98 and 0 99, forsamplesizesn = 3 (1) 50. A normalizingtransformation
for
Wusinga JohnsonSB approximationin the regionn = 7(1)50 was laterproposed(Shapiro
and Wilk, 1968), though tables were still required for n = 4(1) 6.
Extensiveempiricalcomparisonsof Wwithothertestsof non-normality
usingcomputer-
generated pseudo-random numbers indicated that W had good power properties against a
wide range of alternativedistributions,and was thereforetrulyan omnibus test (Shapiro et al.,
1968).Subsequently, otherstatisticsofthe Wtype,namelyY(D'Agostino, 1971),W' (Shapiro
and Francia,1972)and r (Filliben,1975),weredevelopedand shownto have powerproperties
broadlycomparablewiththose of W Anotherapproach was to combine ,lb and b2, the
standardsample measuresof skewnessand kurtosis,into an omnibustest(D'Agostino and
Pearson, 1973; Bowman and Shenton,1975).One such statisticis K2 (Pearson et al., 1977).
The power characteristics of the omnibus tests may be summarizedas follows.For
symmetricalplatykurtic distributions(l/,B= 0, 32 < 3), and formostskewdistributions, Wis
optimal(Pearsonet al., 1977),and is sometimesmarkedlymorepowerfulthanitsnearestrival.
K2, W' and r are all more powerfulthan Wforsymmetric, leptokurticpopulations(B2> 3),
though Wseems littleinferiorforverylong-tailed alternatives,e.g. fB2 = 11. W' and r appear to
have very similar power (Filliben, 1975).
With the exception of Wfor n = 7 (1) 50, the existingomnibus test statisticssufferfromthe
serious disadvantagethat theirsignificancelevels have to be obtained fromtables, and
thereforethe testsare inconvenientforcomputerimplementation. FurthermoreW, whichit
maybe arguedformsthebestgeneraltest,cannotbe calculatedforsampleslargerthan50. The
purpose of the presentpaper is to extend W to sample sizes n -2000, and to develop a
transformation of thenull distribution
of Wto approximatenormalitythroughouttherange
7? n?2000. A methodforcalculatingthesignificance levelof Wforn<7 is also derived.All
( 1982 Royal StatisticalSociety 0035-9254/82/31115 $2.00
116 APPLIED STATISTICS
2. CALCULATION OF W
Let m' = (i1,..., m) denote the vector of expected values of standard normal order
statistics,
and let V= (vii)be the correspondingn x n covariancematrix;thatis
The coefficients
{ai} are the normalized"best linearunbiased"coefficients
tabulatedfor
n?20 by Sarhan and Greenberg(1956). The covariancematrixVwhichfeaturesin a may be
obtained using the -algorithmof Davis and Stephens(1978). However, V is not required
explicitly,and Shapiro and Wilk (1965) offera satisfactoryapproximationfor a which
TABLE 1
Sometheoretical
moments
(pi) and simulation
moments(/i)of W Valuesin thepresentstudyare
based on 6000 simulations
per samplesize
Al 1,/2 ,Xbj b2
02mi, i = 23,
... ,n-1,
=t( z nE,
a--
a* , na-*2),i=1 n, . (2.1)
where
2 ^2 g(n-1), n< 20,
a,= an n>20
)g(n),
and
F(2{n + 1])
g(n) - 12f( n+ 1)
n
g(n) [6n + exp(1)Ln+ )2 (2.2)
3. EXTENSION OF W
Wwas calculatedusingtheformulae(2.1) and (2.2).Values of Wweregeneratedfromsetsof
normal deviates,calculated as the normal integraltransformof uniformpseudo-random
numbers.Wichmannand Hill's (1982) random numbergeneratorwas used. Six thousand
values of W foreach sample size n = 7 (1) 30 (5) 100, 125, 150,200(100) 600, 750, 1000, 1250,
1500 and 2000 weresimulated.Different setsof pseudo-randomnumberswereused foreach
simulation,to avoid dependencebetweenresults.Selectedempiricalfirstand secondmoments
of W are givenin Table 1, and may be comparedwithShapiro and Wilk's (1965, Table 4)
values,whichare exactforE(W) at n< 20 but otherwisebased on extensivesimulation.Use of
theapproximation(2.1) forthedefining coefficients {aj} has had littleeffect
on themomentsof
W1evenat n = 7. A curiousfeatureofTable 1 is thestrongdisagreement betweenour estimates
of 1fB and f2and thosegivenby Shapiro and Wilk. Accordingto our data, skewnessand
kurtosisboth reducein magnitudeas n increasesfrom10, reachingapproximatelynormal
valuesat about n = 750 and thendiverging. Shapiroand Wilkgive>/B = -3 32,f2= 212 43
at n = 50, and stillrisingsharply.We feelthattheirvalues mustbe wrong,and perhapsthat
roundingerrorspoiledtheircalculations.A glanceat theempiricalcumulativedistribution of
W(Fig. 1,and Shapiroand Wilk,Fig. 4) confirms thatWisbecominglessskewas n goes from5
to 50.
118 APPLIED STATISTICS
W 1.00-
1000005
0.96-
82o
0.88-
0.84-
0.92 -
0.80-
1 2 5 10 20 30 50 70 80 90 95
Percentile
plotoftheempiricalcumulativedistribution
FIG. 1.Normalprobability ofW withsamplesizes7, 8, 10,20,50,
function
70, 100,200, 1000.
wherez is a standardnormaldeviate,and pvand ovare themean and s.d. ofy. Equation (4.1)
allows one to calculatethesignificance leveloftheoriginalW Large valuesofz (as opposed to
small values of W) indicatedeparturefromnormality.The quantitiesi., ,y and ay are all
functionsof n.
Estimatesof A wereobtainedas follows.For each n, the correlationcoefficient between
selectedempiricalquantilesof(1 - W)A(the0 1,0 5, 1,2, 3, 5, 10,20, 30,40, 50,60, 70,80,90, 95
and 99 percentagepoints)and theirnormalequivalentdeviateswas maximizedwithrespectto
2 using simplelinear search.Differential weightingaccordingto the varianceof a normal
quantilewas applied.Since thedefinition ofthedefiningcoefficients {la} changesat n = 20, a
"kink"in thefunctioni. = O(n)was anticipated;therefore thenumberofsimulatedvalues of W
used to estimateA was doubledto 12000 forn = 7 (1) 14,trebledforn = 15(1) 17 and 21 (1) 23,
and quadrupledforn = 18(1)20. A slightminimumforA appears at n = 17 and a sudden
downward step at n = 21 (Fig. 2). The estimatesof 2 were smoothed using separate
polynomialsin log(n)-d, whered = 3 forn = 7-20 and d = 5 forn = 21-2000 (Table 2).
The parametersofthedistribution oftransformed W,[y and aywereestimatedas themean
and s.d. of the y's, recalculatedusing smoothedvalues of 2.(Fig. 3). Their logarithmswere
smoothedwithpolynomialsin log (n)- d, again in two parts,n< 20 and n>20 (Table 2).
TABLE 2
for calculationof X, loge(f y) and 1oge (Uy) for the normalizin
Polynomialcoefficients
y = (1 - W)'. Values ofz = (y - iy)/uyhave standard normaldistributioniftheoriginalsam
was calculatedis normal;large values of z indicatenon-normality. The polynomialsar
Eci(log n-d)i, whered = 3 for n< 20, d = 5 for 21 < n< 2000
Coefficients
TABLE 3
for thecalculationof U3 fromUn, n = 4,5,6. U3 may thenbe convertedto
Coefficients
nificancelevelforW (see text)
Sample
size, n Range ofun aO a, a2 a3 a4
A 1.6-
1.4-
1.2-
1.0
0.8-
0.6-
0.4-
0.2-
0 l II I I IIIIIII 1I
I I111 I I I111 I1
7 10 20 30 50 100 200300 500 1000 2000
n
FIG.2. Power,A,requiredin thetransformation of W to normality, ofsamplesize.y = (1 - W)A.Abscissa
as a function
is sample size (log scale). Solid line representssmoothingpolynomials,witha break at n = 20.
Operationalexample
Suppose a sample of size n = 137 yields W= 09620. Referringto Table 2,
x = log(137)-5 = -0080. Then
A = 0 480385+(0 318828)(-0 080) + ... +(0 002989646)(-0 080)5
= 0 4549,
log uy= -1P91487+(- 1 37888)(-0-080)+...+(- 001504614)(-0 080)5
= - 1 8049,
Iuy= 0-1645,
loguy= -3-73538 +(- 1-015807)(-0 080)+...+(0 003852646)(0080)6
= - 3 6563,
uy= 0 02583.
So
z = (y -y)/Uy
= [(1 -09620) 4549-01645]/0-02583
=238 (p<001).
non-normalat the 1 per centlevel.
The sample would be judged significantly
of thenormalizing
Effectiveness transformation
Adequate transformations of W were achievedfornk 7, as judged by the skewnessand
and leptokurtic;
left-skewed
ofy are slightly
kurtosisofy (Fig. 4). The distributions overthe50
sample sizes, the mean (s.d.) of ,lb was -0012 (0032), and of b2 was 3081 (0066).
Approximate95 per centrangesfor,lb, and b2 in normalsamplesof size 6000 are 0+0 063
and 3 + 0 126 respectively.
The smallestsamplesizes
the power transformation
Unfortunately, of W was consideredinadequate for3 < n1< 7.
Wilkand Shapiro(1968) tabulatedselectedvalues ofti = log {(W- e)/(l - W)} againstWand
thestandardnormaldistribution, 1)
wheree, a2 n/(n- is theminimumattainablevalue of W
TESTING NORMALITY OF LARGE SAMPLES 121
My 1 -0.1 ry
0.5 0.05
0.1 0.01
0.05 0.005
0.01- 0.001
0.005 0.0005
0.001 , 0.0001
7 10 20 30 50 100 200 50010002000
n
FIG. 3. Mean (solid line) and s.d. (brokenline) of y = (1 - W)K.Values are forsmoothedvalues of A.All scales are
logarithmic.
v b, 0.08-
0.06-
0.04 - . 0
0.02- *v..@
.
0 . *
-0.02 - . *
-0.04 . * . .
-01081 :1 1
b2 3.2 - . *X
3.1 -. *. *.* * *X X
3.0 - *
p {sin (x2(u)
I sinn 4} (4.4)
Wilk and Shapiro (1968, Table 1) give values of un(n = 3,4,5,6) and corresponding
standard normal quantiles Z,, obtained by simulation.Given Zn, one can calculate an
equivalent value of 1u3 via the standard normal integral, W3 ((4.3) inverted) and
122 APPLIED STATISTICS
= log
[(W3 - )/(1 - W3)]. This providessets ofpairedvalues(Un,U3) fora rangeofp values
at each sample size n = 4,5,6.
One thenfindssuitablefunctions to predictU3 fromu,. Givenan observedWwhosep value
is required,the sequence of operationsis
W -+ Un-+ U3 -+ p.
The last stage is accomplishedby (4.4).
to
Polynomialswereused to fitU3 to un (Table 3). The rangeof applicationis restricted
approximately 0 0002< p < 0 9998.
As an example,suppose n = 5, W= 0 690. For n = 5, E = 0 5523,so
0 690-0 5523
U5= log -8115,
0
1-0 690
U3 = -2 28135+226186(-0 8115)+(-000865763)(-0 8115)4
= -4 121,
-{sin1 I
p =p 7E{i -sin - V
|1 + exp(- 4 )24)s-
12A/4}
= 0 00883.
This resultis close to the value p = 0-0088 obtained by linear interpolationin Wilk and
Shapiro'sTable 1.
5. APPLICATION
Wmaybe put to workin thefieldofestimationand
Besidesitsrole as a testofnormality,
data transformation. one wishes to transformdata to (approximate)
Quite frequently,
and in so doingvaluesforseveralparametersmayhave to be found.For example,
normality,
theJohnsonSB transformation, whichaims to generatea standardnormaldeviatez using
z = y+5y,
where
y = log [(x - 0)/(4+ A - x)]
necessitatesestimationof thefourparametersy, 5,4 and A. Severalmethods(e.g. maximum
likelihood,methodofmoments)have beendevisedto do this.An alternative way to maximize
the normalityof thevariabley is to findvalues of 4 and A whichmaximizeWforthey's. In
general,thisprocedurehas theadvantagesofreducingbytwothenumberofparametersto be
TABLE 4
Values ofc in log(weight-c) as estimatedby themethodofmaximumW(MMW).
Data fromRona and Altman(1977)
REFERENCES
BLOM,G. (1958).StatisticalEstimatesand Transformed Beta-variables.
New York: Wiley.
BOWMAN, K. 0. and SHENTON, L. R. (1975). Omnibustestcontoursfordeparturesfromnormalitybased on lb, and
b2. Biometrika, 62, 243-250.
D'AGosTINo,R. B. (1971).An omnibustestofnormality formoderateand largesamplesizes.Biometrika, 58, 341-348.
D'AGosTINo, R. B. and PEARSON, E. S. (1973). Tests for departurefromnormality.Empirical resultsfor the
distributions of b2 and lb,. Biometrika, 60, 613-622.
DAVIS,C. S. and STEPHENS, M. A. (1978). AlgorithmAS 128. Approximating thecovariancematrixof normalorder
statistics.Appl.Statist.,27, 206-212.
DE WET,T. and VENTER, J.H. (1972).Asymptotic ofcertaintestcriteriaofnormality.
distributions S. AfricaStatist.J.,
6, 135-150.
FILLIBEN, J.J.(1975). The probabilityplot correlationcoefficient testfornormality.Technometrics, 17, 111-117.
HARTER, H. L. (1961). Expectedvalues of normalorderstatistics.Biometrika, 48, 151-165.
JOHNSON, N. L. (1949). Systemsof frequency curvesgeneratedby methodsof translation.Biometrika, 36, 149-176.
PEARSON,E. S., D'AGOSTINO, R. B. and BOWMAN,K. 0. (1977). Tests for departure from normality: comparison of
powers.Biometrika, 64, 231-246.
RONA,R. J.and ALTMAN, D. G. (1977).NationalStudyofHealthand Growth:standardsofattainedheight,weightand
tricepsskinfoldin Englishchildren5 to 11 yearsold. Ann.Hum.Biol.,4, 501-523.
ROYSTON, J.P. (1982).Algorithm AS 177. Expectednormalorderstatistics (exactand approximate).Appl.Statist.,31,
161-165.
SARHAN, A. E. and GREENBURG, B. G. (1956). Estimationof location and scale parametersby orderstatisticsfrom
singlyand doublycensoredsamples.Part I. Ann.Math. Statist.,27, 427-451.
SHAPIRO,S. S. and FRANCIA, R. S. (1972).An approximateanalysisofvariancetestfornormality. J. Amer.Statist.Ass.,
67, 215-216.
124 APPLIED STATISTICS