Skip to main content
v2026.11,858 entries · CC-BY 4.0

sktest in Stata: Syntax, Output and swilk

How to run sktest in Stata, read its skewness and kurtosis output, and when to use swilk for the Shapiro-Wilk test instead.

Written and maintained by CASRAI Editorial Board

Last updated

The sktest command in Stata tests whether a variable is normally distributed by combining a skewness test and a kurtosis test into one joint test. A small joint p-value rejects normality, and the two separate p-values show whether skewness, kurtosis or both drive the result. It is not the Shapiro-Wilk test: that is a different command, swilk, covered below.

What it is used for in research

Many parametric methods assume approximately normal data or residuals, so researchers check normality before choosing a method. Stata’s manual describes sktest as presenting, for each variable, “a test for normality based on skewness and another based on kurtosis” and then combining the two into an overall test statistic. It needs at least eight observations.

The manual also states that Shapiro-Wilk and Shapiro-Francia are in general preferred for nonaggregated data, that a normal quantile plot should accompany any test for normality, and that sktest is the tool for finding the source of the problem once normality is rejected. A p-value alone should not decide between a parametric and a non-parametric method; see normality of distribution and how to choose a statistical test.

Install or access (official source only)

sktest is an official Stata command documented in the Stata Base Reference Manual under [R] sktest, so no add-on is needed. In the menus it is at Statistics > Summaries, tables, and tests > Distributional plots and tests > Skewness and kurtosis normality tests. The manual page for Release 19 is stata.com/manuals/rsktest.pdf (checked 2026-10-29).

Step-by-step: running sktest

  1. Load your data. The manual’s example uses the 1978 automobile data: use https://www.stata-press.com/data/r19/auto.
  2. Run the test on one or more variables: sktest mpg trunk. The general syntax is sktest varlist [if] [in] [weight] [, options]; aweights and fweights are allowed, for example sktest v1 v2 [fweight=wvar].
  3. Read the table (next section).
  4. Optional: add noadjust (sktest v1 v2, noadjust) to switch off the empirical adjustment described below.
  5. Look at the data as well, with a histogram (see histograms in Stata), qnorm, and summarize varname, detail (see descriptive statistics in Stata).

Output and how to read it

The manual’s example output is headed “Skewness and kurtosis tests for normality” with a joint test. The columns are Variable, Obs, Pr(skewness), Pr(kurtosis), Adj chi2(2) and Prob>chi2.

Variable Obs Pr(skewness) Pr(kurtosis) Adj chi2(2) Prob>chi2
mpg 74 0.0015 0.0804 10.95 0.0042
trunk 74 0.9115 0.0445 4.19 0.1228

Source: Stata [R] sktest, auto data example. For mpg the joint test rejects normality. For trunk the manual says normality cannot be rejected “at least at the 12% level”, even though the kurtosis p-value (0.0445) is below 0.05 on its own, which shows why the two component tests and the joint test can point in different directions. The manual notes trunk’s kurtosis is 2.19, which you can confirm with summarize trunk, detail.

The adjusted chi-squared and noadjust

The overall statistic combines the skewness and kurtosis statistics (Z1 and Z2) as K2 = Z12 + Z22, approximately chi-squared with 2 degrees of freedom under normality. By default Stata applies Royston’s (1991) empirical adjustment; noadjust suppresses it and presents the unaltered D’Agostino, Belanger and D’Agostino (1990) test. In the same example the unadjusted chi-squared would be 13.13 for mpg and 4.05 for trunk. If the adjusted chi-squared prints as a period, the manual says to read it as “an absurdly large number; the data are most certainly not normal.”

Stored results

After sktest, these are available in r(): r(N), r(chi2), r(p_skew), r(p_kurt), r(p_chi2) and the matrix r(table). That lets a do-file branch on r(p_chi2) or write the p-values to a table.

swilk: the Shapiro-Wilk alternative in Stata

For the Shapiro-Wilk test in Stata, use swilk, not sktest. Its menu path is Statistics > Summaries, tables, and tests > Distributional plots and tests > Shapiro-Wilk normality test. Syntax: swilk varlist [if] [in] [, generate(newvar) lnnormal noties]. The manual (stata.com/manuals/rswilk.pdf, checked 2026-10-29) says swilk can be used with 4 ≤ n ≤ 2000 observations.

Running swilk mpg trunk on the auto data gives a table headed “Shapiro-Wilk W test for normal data” with columns Variable, Obs, W, V, z and Prob>z:

Variable Obs W V z Prob>z
mpg 74 0.94821 3.335 2.627 0.00430
trunk 74 0.97921 1.339 0.637 0.26215

The manual’s reading: normality of mpg can be rejected, normality of trunk cannot. V is a transform of W with a median of 1 for samples from normal populations, and large values indicate nonnormality; it carries no more information than W. Stored results are r(N), r(W), r(p), r(V) and r(z).

Shapiro-Wilk test on a log scale

To test for lognormality, generate the log of the variable and test that, for example generate lnstudytime = ln(studytime) then swilk lnstudytime (the manual’s cancer data example, 48 observations, W = 0.92731, Prob>z = 0.00543). The lnnormal option is for a three-parameter lognormal, ln(X − k) with k chosen to make skewness zero; the manual says not to use it for plain lognormality.

sfrancia and the three commands side by side

sfrancia runs the Shapiro-Francia W’ test: sfrancia varlist [if] [in] [, boxcox noties]. On the auto data it also rejects normality for mpg (Prob>z 0.00604) but not for trunk (0.42271).

Command Test Observations allowed Stored p-value
sktest Skewness and kurtosis, joint at least 8 r(p_chi2)
swilk Shapiro-Wilk W 4 to 2000 r(p)
sfrancia Shapiro-Francia W’ 10 to 5000 (5 to 1000 with boxcox) r(p)

Troubleshooting

  • Samples that are too small. sktest requires at least eight observations; swilk at least four; sfrancia at least ten.
  • Too many observations for swilk. Above 2000, use sfrancia (up to 5000) or sktest, which the manual says permits more observations.
  • Chi-squared shown as a period. Treat it as an extremely large statistic and strong evidence against normality, per the manual.
  • The component tests disagree. This is normal (see trunk above); the joint test is the overall verdict and the components point to skewness or kurtosis.
  • Long variable names truncate the table. The nolstretch option stops the table being widened for long names.

Free alternatives and companion checks

Option What it does Where to learn more
qnorm (Stata) Normal quantile plot, which the Stata manual says should accompany any normality test What is a Q-Q plot
shapiro.test() (R) Shapiro-Wilk test in the free R environment Shapiro-Wilk test in R

Users of other packages can compare with testing normality in SPSS. After deciding on a non-parametric approach, see the Mann-Whitney test (ranksum) in Stata.

FAQ

Is sktest the same as the Shapiro-Wilk test in Stata?

No. sktest is a skewness and kurtosis test; the Shapiro-Wilk test is swilk. The Stata manual prefers Shapiro-Wilk or Shapiro-Francia for nonaggregated data and positions sktest for diagnosing the source of non-normality.

How do I run a Shapiro-Wilk test in Stata?

Type swilk varname, or use Statistics > Summaries, tables, and tests > Distributional plots and tests > Shapiro-Wilk normality test. A small Prob>z means normality is rejected.

What does a significant sktest result mean?

A small Prob>chi2 rejects the null hypothesis that the variable is normally distributed. Check Pr(skewness) and Pr(kurtosis) to see which part contributes, and plot the data.

Sources (official docs)

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about sktest in Stata: Syntax, Output and swilk

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Ask CASRAI · Regulatory Radar

Research-admin question? Get an answer that links its sources.

An AI assistant specialized in research administration. Every answer links its sources to check before you act. 2 questions free, no account. $29/month after.

  • Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.
  • Every answer numbers its sources and links each one, so you can check the source yourself.