Understanding the Output
For both tests the null hypothesis is "the variable is normally
distributed":
With large survey samples these tests flag even tiny, practically
irrelevant deviations. Combine them with the skewness and kurtosis
from describe before deciding against a parametric test.
When to Use This
Before t_test, oneway_anova, or
pearson_cor to check the normality assumption
Grouped (via group_by()) to check normality within
each comparison group — the form of the assumption that actually
matters for group comparisons
If normality is clearly violated, consider the rank-based
alternatives: mann_whitney, kruskal_wallis,
or spearman_rho.
Technical Details
The Lilliefors-corrected p-value uses the Dallal-Wilkinson (1986)
approximation, the same correction SPSS applies in EXAMINE
("Lilliefors Significance Correction"). Shapiro-Wilk uses
stats::shapiro.test() and is reported for 3 <= n <= 5000,
as in SPSS. Cases with missing values are excluded per variable.
Weights: normality_test() deliberately takes no
weights argument. Normality checks are a diagnostic of the
sample distribution, and neither Shapiro-Wilk nor the
Lilliefors correction has a well-defined fractional-frequency-weight
form. Run the test on the unweighted sample.
An SPSS v29 EXAMINE reference run is pending; until it lands the
statistics are verified against independent R implementations of the
same published formulas (see the SPSS compatibility vignette).