← All posts

Normality Test: Shapiro–Wilk, Lilliefors, SD vs. Mean Rule, Pearson r, and MAD

Clinical Epidemiology ResearchUniqcret doctor knowledgesData Analytics or Statistics
On this page

Comparison Table of Normality Assessment Methods


🔍 M1 – Shapiro–Wilk Test

📍 When to Use It (Indications)

  1. Small to moderate samples (n < 5000):
    • Especially optimal for small datasets (n < 50).
    • Ideal during preliminary checks before running t-tests, ANOVA, or parametric regression models.
  2. When assumptions about normality matter:
    • Used when modeling continuous variables as outcomes or predictors.
  3. Assessing lab values, scores, or clinical endpoints:
    • Common in clinical trials and biomarker studies where means or SDs drive decisions.

⚙️ How It Works – Behind the Scenes

The Shapiro–Wilk test compares:

It builds a test statistic, W, which summarizes:

W = ( Predicted alignment with normal ) 2 Sample variance

The p-value is derived from simulation, not a formula — it tells how likely it is to see your W by chance if the data were normal.

🧠 Now in Plain Language

✅ Pros

FeatureBenefit
Very powerful in small samplesBest-in-class for detecting non-normality with n < 50
Captures subtle deviationsSensitive to skewness and kurtosis
Widely availableBuilt into R (shapiro.test()), SPSS, Python, etc.
Exact distributionUses simulation-based p-values instead of large-sample approximations

❌ Cons

LimitationImpact
Overly sensitive at large nMay reject normality due to tiny, irrelevant deviations if n > 5000
Univariate onlyDoesn’t test multivariate normality (e.g., for MANOVA)
Assumes continuous dataPoor performance with many tied or rounded values
Doesn’t diagnose type of deviationFlags abnormality but not whether it’s skew, bimodal, or heavy-tailed

🩺 Clinical Analogy

Think of a nurse checking a patient’s pulse pattern against a reference ECG.

Shapiro–Wilk plays the same role for your data’s shape — spotting subtle irregularities in statistical “rhythm.”


🔍 M2 – Lilliefors Test (a smarter Kolmogorov–Smirnov test)

📍 When to Use It (Indications)

  1. Moderate-to-large samples (n > 50) where you suspect:
    • You need to test normality, but the true population mean and SD are not known a priori.
    • You're about to run regression models or ANOVA, and want to check that residuals or continuous predictors are normal-like.
  2. Real-world data: clinical or biomarker data that likely doesn't follow textbook distributions.
  3. Use in simulation pipelines, especially when evaluating robustness of new normality classifiers.

⚙️ How It Works – Formula Intuition (Light)

Think of this as a shape comparison test.

  1. First, calculate your empirical cumulative distribution function (ECDF). This is just:

“At each point, what % of the data lies below or at this value?”

  1. Next, assume your data is normal—but you estimate the mean and SD from your sample.
  2. Now generate the theoretical normal CDF based on those estimates (like a reference curve).
  3. The test statistic D is the biggest vertical distance between the ECDF (your data) and the reference CDF (ideal normal):
D = max | F n (x) Φ ( x ; μ^ , σ^ ) |

Where:

“Your data deviates from normality more than we’d expect by chance.”

🧠 Now in Plain English (No Formulas)

✅ Pros

FeatureBenefit
No need to know population mean/SDPerfect for real-world data where parameters are unknown
Good for mid-to-large nRobust and interpretable even with 1000+ observations
Sensitivity in tailsPicks up deviations at extreme high or low values
Graph-friendlyPairs well with ECDF plots for visual inspection

❌ Cons

LimitationImpact
Less powerful than Shapiro–Wilk for small nMay fail to detect subtle skewness if n < 50
Not designed for multivariate normalityJust like Shapiro, it's univariate
Over-sensitive with large nLike most tests, it may flag trivial differences when n is very large
Less intuitive p-value logicSimulated critical values needed for significance thresholds

🩺 Clinical Analogy

Suppose you have 100 patients’ fasting glucose levels.

That’s what Lilliefors is checking.


 🔍 M3 – Heuristic Rule: 2 × SD < Mean

📍 When to Use It (Indications)

  1. Quick screening in clinical datasets:
    • Commonly applied to positively skewed, non-negative variables like:
      • Length of Stay (LOS)
      • Hospital charges
      • Biomarkers (e.g., CRP, D-dimer)
      • Patient-reported scores (on unipolar scales)
  2. When graphical tools or formal tests aren’t feasible:
    • Used in exploratory analysis, dashboards, or pre-modeling pipelines for triage.
  3. As a flag before transformation:
    • Indicates when a variable may need log transformation or non-parametric handling.

⚙️ How It Works – Intuition & Calculation

This rule assumes a basic property of right-skewed distributions: their spread (SD) is large compared to their central tendency (mean).

Formula:

\(\text{If } 2 \times \text{SD} < \text{Mean} \Rightarrow \text{Likely Normal or Left-Skewed}\) \(\text{If } 2 \times \text{SD} \geq \text{Mean} \Rightarrow \text{Right-Skewed}\)

Why “2×SD”? Because in a normal distribution:

🧠 Now in Plain Language

Let’s say you measure LOS in ICU:

It doesn’t test normality rigorously. Instead, it waves a yellow flag:

“Watch out — this might not be symmetric; better check the distribution.”

Think of it as a quick visual cue in numeric form.

✅ Pros

FeatureBenefit
Ultra-fast to computeNo coding or stats required — just two values
Good for pre-modeling screeningFlags likely-skewed variables before regression or comparison tests
Clinically interpretableTaps into real-world understanding of variable distributions (e.g., LOS rarely looks like a bell curve)

❌ Cons

LimitationImpact
Not a statistical testDoesn’t give p-values or control for sample size
Fails in symmetric but non-normal dataCan misclassify if tails are heavy or the distribution is bimodal
Breaks on near-zero or negative valuesMean close to 0 or data with negative values yields nonsense
Overly sensitive to outliersA few large values can distort the SD and mislead the rule

🩺 Clinical Analogy

Imagine you’re estimating ICU LOS across patients:

🔄 Summary


 🔍 M4a – Correlation-Based QQ Alignment (Pearson r ≥ 0.95)

📍 When to Use It (Indications)

  1. When you want an algorithmic version of QQ plot interpretation:
    • Converts the visual judgment of "normal-looking" plots into a quantitative cutoff.
  2. Medium-to-large datasets (n ≥ 30):
    • Especially useful when Shapiro–Wilk becomes over-sensitive or you want to bypass p-value pitfalls.
  3. When batch-scanning many variables:
    • Can be run on hundreds of variables automatically, flagging which ones are far from normal by rank-based alignment.
  4. As a validation step for normality transformations:
    • Helps confirm whether log-transform, Box-Cox, or Winsorization brought a variable closer to symmetry.

⚙️ How It Works – Formula Logic

This method compares:

Then calculates:

r = correlation ( Q sample , Q normal )

Where:

A high Pearson r (≥ 0.95) means:

🧠 Now in Plain Language

“If r ≥ 0.95, I’ll treat this as normal.”

It’s like putting a straight-edge ruler over your QQ plot and checking the fit — but with math.

✅ Pros

FeatureBenefit
No p-value overinterpretationFocuses on pattern, not statistical significance
Visual + numeric hybridReplaces subjective QQ plot reading with objective threshold
Great for automationCan be used in pipelines screening 100+ variables
Not disrupted by minor outliersModerate robustness when compared to variance-sensitive tests

❌ Cons

LimitationImpact
Arbitrary threshold (0.95)No universal justification — may need tuning by domain
Not a test → no p-valueCan't say how unlikely the observed r is under true normality
Only tests linearityDoesn’t distinguish skew vs kurtosis problems — both just lower r
Sample-size sensitivityIn very small samples, correlation may be high by chance; in large samples, tiny deviations lower r

🩺 Clinical Analogy

Think of checking whether a patient’s BP readings follow a standard 24-hour circadian pattern:

This method checks your data’s rhythm against the ideal bell curve.

🧪 Threshold Justification


🔍 M4b – AUC-Based Deviation from QQ Line(MAD ≤ 0.15)

📍 When to Use It (Indications)

  1. When you're analyzing data prone to outliers:
    • Ideal for healthcare cost, ICU stay, biomarker spikes — where extreme values exist, but you want to focus on the overall pattern.
  2. **When you want to quantify the shape mismatch in QQ plots:
    • Rather than asking “is the line straight?” (M4a), this asks “how far off are these points, on average?
  3. For visual normality assessments you want to standardize:
    • Use this to replace human-rater variability in training sets or simulation pipelines.
  4. Useful in NLP/ML pipelines where robustness matters:
    • When building risk scores, lab data normality affects modeling choice — this method can help automate preprocessing logic.

⚙️ How It Works – Formula Logic

1.Standardize your data:

z i = x i x ¯ s

Where:

  1. xi = original data
  2. xˉ = sample mean
  3. s = SD

2. Generate theoretical normal quantiles:

3. Compute mean absolute deviation from the line:

MAD = 1 n i = 1 n | z (i) q i , normal |

4. Decision rule:

🧠 Now in Plain Language

“This variable walks the line — it’s close enough to normal.”

Think of this as checking how much “wobble” your data has around the perfect QQ line.

✅ Pros

FeatureBenefit
Outlier-resistantUses absolute (not squared) differences — less distortion from extreme values
Good at detecting curvaturePicks up on subtle S-shapes or U-bends in QQ plots
Numerically stableDoesn’t depend on correlation, variance, or p-values
Straightforward thresholdMAD ≤ 0.15 is intuitive and consistent

❌ Cons

LimitationImpact
No formal testNo p-value or simulation-based cutoff; it’s a heuristic threshold
Threshold (0.15) is empiricalBased on calibration to human rating — needs justification in new domains
Assumes linearity is idealMay misflag “perfectly symmetric but heavy-tailed” data as non-normal
Requires standardized dataCan't use on raw units; adds preprocessing step

🩺 Clinical Analogy

Think of comparing a patient’s ECG trace to a healthy standard:

“Looks good overall — no clinical concern.”

This method measures that “average wobble” — point-by-point mismatch from normality.

🔬 Threshold Justification

0
Message for International and Thai ReadersUnderstanding My Medical Context in ThailandRead more →Message for International and Thai ReadersUnderstanding My Broader Content Beyond MedicineRead more →

Comments

No comments yet. Be the first to share your thoughts.

Sign in to comment