Example: confidence

Syntax - Stata

Skewness and kurtosis test for normalitySyntaxMenuDescriptionOptionRema rks and examplesStored resultsMethods and formulasAcknowledgmentsReferencesAlso seeSyntaxsktestvarlist[if] [in] [weight] [, noadjust]aweights andfweights are allowed; see[U] >Summaries, tables, and tests>Distributional plots and tests>Skewness and kurtosis normality testDescriptionFor each variable invarlist,sktestpresents a test for normality based on skewness and anotherbased on kurtosis and then combines the two tests into an overall test aminimum of 8 observations to make its calculations.

. 1992.sg11.1: Quantile regression with bootstrapped standard errors. Stata Technical Bulletin 9: 19–21. Reprinted in Stata Technical Bulletin Reprints, vol. 2, pp. 137–139. College Station, TX: Stata Press. sktest— Skewness and kurtosis test for normality 5

Tags:

  Regression, Quantile, Quantile regression

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Syntax - Stata

1 Skewness and kurtosis test for normalitySyntaxMenuDescriptionOptionRema rks and examplesStored resultsMethods and formulasAcknowledgmentsReferencesAlso seeSyntaxsktestvarlist[if] [in] [weight] [, noadjust]aweights andfweights are allowed; see[U] >Summaries, tables, and tests>Distributional plots and tests>Skewness and kurtosis normality testDescriptionFor each variable invarlist,sktestpresents a test for normality based on skewness and anotherbased on kurtosis and then combines the two tests into an overall test aminimum of 8 observations to make its calculations.

2 See [MV]mvtest normalityfor multivariatetests of Main noadjustsuppresses the empirical adjustment made by Royston (1991c) to the overall 2andits significance level and presents the unaltered test as described by D Agostino, Belanger, andD Agostino (1990).Remarks and see [R]swilkfor 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 plotsfor more sktest Skewness and kurtosis test for normalityExample 1 Using our automobile dataset, we will test whether the variablesmpgandtrunkare normallydistributed.

3 Use (1978 Automobile Data). sktest mpg trunkSkewness/Kurtosis tests for NormalityjointVariableObs Pr(Skewness) Pr(Kurtosis) adj chi2(2) Prob>chi2mpg74 can reject the hypothesis thatmpgis normally distributed, but we cannot reject the hypothesisthattrunkis normally distributed, at least at the 12% level. The kurtosis fortrunkis , as canbe verified by issuing the command. summarize trunk, detail(output omitted)and thep-value of shown in the table above indicates that it is significantly different fromthe kurtosis of a normal distribution at the 5% significance level.

4 However, on the basis of skewnessalone, we cannot reject the hypothesis thattrunkis normally notesktestimplements the test as described by D Agostino, Belanger, and D Agostino (1990) but withthe adjustment made by Royston (1991c). In the above example, if we had specified thenoadjustoption, the 2values would have been formpgand fortrunk. With the adjustment, the 2value might show as .. This result should be interpreted as an absurdly large number; the dataare most certainly not resultsskteststores the following inr():Scalarsr(chi2) 2r(Pskew)Pr(skewness)r(Pkurt)Pr(kurtosis )r(Pchi2)Prob>chi2 Matricesr(N)matrix of observationsr(Utest)matrix of test results, one row per variablesktest Skewness and kurtosis test for normality 3 Methods and formulassktestimplements the test described by D Agostino, Belanger, and D Agostino (1990) with theempirical correction developed by Royston (1991c).

5 Letg1denote the coefficient of skewness andb2denote the coefficient of kurtosis as calculatedbysummarize, and letndenote the sample size. If weights are specified, theng1,b2, andndenote the weighted coefficients of skewness and kurtosis and weighted sample size, [R]summarizefor the formulas for skewness and perform the test of skewness, we computeY=g1{(n+ 1)(n+ 3)6(n 2)}1/2 2(g1) =3(n2+ 27n 70)(n+ 1)(n+ 3)(n 2)(n+ 5)(n+ 7)(n+ 9)W2= 1 + [2{ 2(g1) 1}]1/2 ={2/(W2 1)}1/2andThen the distribution of the test statisticZ1=1 lnWln[Y/ +{(Y/ )2+ 1}1/2]is approximately standard normal under the null hypothesis that the data are distributed perform the test of kurtosis, we computeE(b2) =3(n 1)n+ 1var(b2) =24n(n 2)

6 (n 3)(n+ 1)2(n+ 3)(n+ 5)X={b2 E(b2)}/ var(b2) 1(b2) =6(n2 5n+ 2)(n+ 7)(n+ 9){6(n+ 3)(n+ 5)n(n 2)(n 3)}1/2A= 6 +8 1(b2)[2 1(b2)+{1 +4 1(b2)}1/2]andThen the distribution of the test statisticZ2=1 2/(9A) (1 29A) {1 2/A1 +X 2/(A 4)}1/3 is approximately standard normal under the null hypothesis that the data are distributed Agostino, Balanger, and D Agostino Jr. s omnibus test of normality uses the statisticK2=Z21+Z22which has approximately a 2distribution with 2 degrees of freedom under the null of sktest Skewness and kurtosis test for normalityRoyston (1991c) proposed the following adjustment to the test of normality, whichsktestusesby default.

7 Let (x)denote the cumulative standard normal distribution function forx, and let 1(p)denote the inverse cumulative standard normal function [that is,x= 1{ (x)}]. Definethe following terms:Zc= 1{exp( 12K2)}Zt= ( 5 + ) exp( )b1= 1 + ( ) exp( )a2=a1 { (1 )}Ztb2= (1 ) +b1andIfZc< 1setZ=Zc; else ifZc< ZtsetZ=a1+b1Zc; else setZ=a2+b2Zc. DefineP= 1 (Z). ThenK2= 2lnPis approximately distributed 2with 2 degrees of relative merits of the skewness and kurtosis test versus the Shapiro Wilk and Shapiro Franciatests have been a subject of debate. The interested reader is directed to the articles in theStata TechnicalBulletin.

8 Our recommendation is to use the Shapiro Francia test whenever possible, that is, wheneverdealing with nonaggregated or ungrouped data (Gould and Rogers 1991; Gould 1992); see [R] normality is rejected, usesktestto determine the source of the both D Agostino, Belanger, and D Agostino (1990) and Royston (1991d) mention, researchersshould also examine the normal quantile plot to determine normality rather than blindly relying on afew test statistics. See theqnormcommand documented in [R]diagnostic plotsfor more informationon normal quantile similar in spirit to the Jarque Bera (1987) test of normality.

9 The Jarque Bera teststatistic is also calculated from the sample skewness and kurtosis, though it is based on asymptoticstandard errors with no corrections for sample size. In effect,sktestoffers two adjustments forsample size, that of Royston (1991c) and that of D Agostino, Belanger, and D Agostino (1990).Acknowledgmentssktesthas benefited greatly by the comments and work of Patrick Royston of theMRCC linicalTrials Unit, London, and coauthor of the Stata Press bookFlexible Parametric Survival AnalysisUsing Stata : Beyond the Cox Model. At this point, the program should be viewed as due as much toRoyston as to us, except, of course, for any errors.

10 We are also indebted to Nicholas J. Cox of theDepartment of Geography at Durham University,UK, and coeditor of theStata Journalfor his Agostino, R. B., A. J. Belanger, and R. B. D Agostino, Jr. 1990. A suggestion for using powerful and informativetests of Statistician44: 316 1991. : Comment on tests of Technical Bulletin3: 20. Reprinted inStata TechnicalBulletin Reprints, vol. 1, pp. 105 106. College Station, TX: Stata , W. W. 1991. sg3: Skewness and kurtosis tests of Technical Bulletin1: 20 21. Reprinted inStata Technical Bulletin Reprints, vol.


Related search queries