Are the Data Normally Distributed?
Many statistical methods — the $t$-test, analysis of variance, Pearson correlation, and the parametric reference interval, among others — assume that the data, or the residuals from a model, follow a normal distribution. Applying these methods when the assumption is badly violated can produce misleading $p$-values, confidence intervals that do not achieve their nominal coverage, and reference limits that misclassify healthy individuals. Before choosing between a parametric and a non-parametric method, it is therefore worth examining whether the normality assumption is plausible. The tools for this fall into two categories: graphical methods that reveal the shape and location of any departure, and formal hypothesis tests that provide an objective decision criterion. In practice, both should be used together.
When Normality Matters
The importance of the normality assumption depends on the sample size and the method being applied. For large samples — roughly $n > 100$ — many test statistics converge to a normal distribution by the central limit theorem regardless of the shape of the underlying data, and mild non-normality has little practical effect on $p$-values or confidence intervals. For small samples, the assumption is load-bearing: the $t$-distribution-based confidence interval for a mean in a sample of 15 patients genuinely relies on the underlying data being approximately normal, and heavy skewness or outliers can distort the result substantially.
A separate consideration applies to reference intervals. The parametric reference interval (mean ± 1.96 SD) is sensitive to the normality assumption at any sample size, because it extrapolates to the tails of the distribution. A right-skewed distribution will produce a parametric upper limit that is too high and a lower limit that is too low, misclassifying healthy individuals at both ends. For this reason, normality assessment is always a required step before applying the parametric method for reference intervals.
Graphical Methods
Graphical examination should always precede formal testing. A histogram (see the Visualizing univariate data chapter) gives an immediate impression of shape: a normal distribution produces a roughly symmetric bell-shaped histogram, while right skew, left skew, bimodality, or heavy tails are immediately visible. Histograms are, however, sensitive to bin width and can be misleading in small samples.
The most powerful graphical tool for normality assessment is the normal Q-Q plot (quantile-quantile plot), introduced and illustrated in the Visualizing univariate data chapter. In brief: sorted data quantiles are plotted against the corresponding theoretical normal quantiles; normally distributed data fall close to the diagonal reference line, and systematic departures — an S-shaped curve indicating skewness, tail arching indicating heavy or light tails, or an isolated extreme point suggesting an outlier — reveal both the presence and nature of any non-normality. The Q-Q plot is more sensitive than the histogram to departures in the tails, which is precisely where normality is most consequential for reference intervals and for the validity of significance tests.
Formal Tests for Normality
Formal hypothesis tests of normality evaluate $H_0$: the data are drawn from a normal distribution, against $H_1$: they are not. A significant result ($p < 0.05$) provides evidence against normality; a non-significant result does not prove normality, only that the sample is consistent with it. MedCalc computes four tests in its Summary statistics procedure.
Shapiro–Wilk Test
The Shapiro–Wilk test (Shapiro & Wilk, 1965) is widely regarded as the most powerful test for normality for small to moderate samples. It computes a statistic $W$ — the ratio of the best linear unbiased estimate of the variance (based on the expected order statistics of a normal sample) to the ordinary sample variance:
$$ W = \frac{\left(\sum_{i=1}^{n} a_i x_{(i)}\right)^2}{\sum_{i=1}^{n}(x_i - \bar{x})^2} $$where $x_{(i)}$ are the ordered observations and the coefficients $a_i$ are derived from the expected values and covariances of order statistics from a standard normal distribution. $W$ ranges from 0 to 1; a value of 1 indicates perfect normality, and smaller values indicate increasing departure. The associated $p$-value is obtained from tabulated critical values. The Shapiro–Wilk test is the preferred choice for samples up to a few hundred observations.
Shapiro–Francia Test
The Shapiro–Francia test (Shapiro & Francia, 1972) is a simplification of the Shapiro–Wilk test that works well across a wider range of sample sizes, including larger samples where the Shapiro–Wilk computation becomes demanding. The statistic $W'$ is the squared correlation between the ordered observations and the expected normal order statistics (approximated as $\Phi^{-1}((i - 3/8)/(n + 1/4))$):
$$ W' = \frac{\left(\sum_{i=1}^{n} m_i x_{(i)}\right)^2}{\left(\sum m_i^2\right)\sum(x_i - \bar{x})^2} $$where $m_i$ are the approximated expected order statistics. $W'$ is again bounded between 0 and 1. The Shapiro–Francia test tends to perform particularly well when the alternative to normality is a long-tailed (leptokurtic) distribution, and is a good choice when sample size exceeds approximately 50.
D'Agostino–Pearson Test
The D'Agostino–Pearson test (D'Agostino & Pearson, 1973) takes a different approach: it tests normality by separately examining two characteristics of the distribution — skewness and kurtosis — and combines them into an omnibus statistic. Standardised measures of skewness ($Z_{g_1}$) and excess kurtosis ($Z_{g_2}$) are each referred to a normal distribution, and their squared values are summed to give the $K^2$ statistic:
$$ K^2 = Z_{g_1}^2 + Z_{g_2}^2 $$which follows a $\chi^2$ distribution with 2 degrees of freedom under $H_0$. The practical advantage of this approach is that it diagnoses the nature of the departure: a significant result driven primarily by $Z_{g_1}$ indicates skewness, while one driven by $Z_{g_2}$ indicates heavy or light tails. This information guides the choice of remedial action — log transformation for skewness, robust methods for heavy tails. The test performs well for moderate to large samples ($n \geq 20$).
Kolmogorov–Smirnov Test
The Kolmogorov–Smirnov test compares the empirical cumulative distribution function of the data with the theoretical normal CDF, and uses the maximum absolute difference between them as the test statistic:
$$ D = \sup_x |F_n(x) - F(x)| $$When the mean and standard deviation are estimated from the data rather than known a priori — which is always the case in practice — the critical values must be adjusted using the Lilliefors correction (Lilliefors, 1967); the standard Kolmogorov–Smirnov test without this correction is too conservative. Even with the correction, the test is generally less sensitive than the Shapiro–Wilk test for detecting departures from normality, particularly in small samples. It is included because it is widely known and requested, but the Shapiro–Wilk or Shapiro–Francia test should be preferred when possible.
Interpreting the Tests
Normality tests are subject to a fundamental tension that limits their usefulness when used mechanically. In small samples — where normality matters most for the validity of subsequent analyses — the tests have low statistical power and frequently fail to detect genuine non-normality. In large samples — where the central limit theorem diminishes the importance of the normality assumption — the tests have very high power and will detect even trivially small, clinically irrelevant departures from normality that have no practical consequences. A result of $p = 0.03$ in a sample of 500 may reflect a barely perceptible deviation that causes no problem whatsoever for a $t$-test; the same $p = 0.03$ in a sample of 12 may reflect a substantial skewness that genuinely undermines the analysis.
For this reason, formal tests should be interpreted alongside the Q-Q plot and in the context of the sample size. The following approach is practical:
- For $n < 50$: use Shapiro–Wilk; examine the Q-Q plot carefully; non-significant results do not guarantee normality in small samples.
- For $n$ 50–2000: Shapiro–Francia or D'Agostino–Pearson; the Q-Q plot remains informative.
- For $n > 2000$: rely primarily on the Q-Q plot and the practical size of any departure; a significant test result is almost inevitable and may be uninformative.
When tests and graphs disagree, the Q-Q plot usually provides more diagnostic information about what is actually happening.
Log Transformation
Many laboratory measurements and biological quantities are right-skewed: a long upper tail reflects the fact that values can be very high but not very low, and that multiplicative rather than additive processes generate the variability. Examples include serum concentrations of hormones and markers, microbiological colony counts, antibody titres, and survival times. For such variables, a logarithmic transformation — replacing each observation $x$ with $\log(x)$ — frequently produces a distribution that is approximately normal, restoring the validity of parametric methods.
The practical rationale is straightforward: if a variable is log-normally distributed, its logarithm follows a normal distribution. Log-normality is very common in biomedical data because many biological processes are governed by multiplicative effects — a drug that doubles a concentration in one patient will double it in another, not increase it by the same absolute amount.
Several aspects of working with log-transformed data deserve attention. First, the transformation requires all values to be strictly positive; zero values require a preliminary shift ($\log(x + c)$ for some small constant $c$) or an alternative approach. Second, after analysis on the log scale, results must be back-transformed by exponentiation. The back-transformed mean of log values is the geometric mean, which is the appropriate measure of centre for a log-normal distribution and is typically lower than the arithmetic mean. Third, differences on the log scale correspond to ratios on the original scale: a difference of $\log(2)$ between two group means on the log scale means one group has values twice as high as the other. Confidence intervals and effect measures back-transform naturally using the same exponentiation.
MedCalc includes a log transformation option in many of its statistical procedures — including the $t$-test, ANOVA, reference interval, and regression procedures — so that the entire analysis, including confidence intervals and graphical output, is performed on the transformed scale and results are back-transformed to the original scale for ease of interpretation. When normality is achieved after log transformation, the parametric analysis on the transformed data is preferable to a non-parametric analysis on the original scale, because it produces effect estimates with confidence intervals rather than merely a $p$-value.
MedCalc computes all four normality tests together with summary statistics in its Summary statistics procedure.