Shapiro-Wilk Test
Shapiro-Wilk Test
Overview
Definition
Shapiro-Wilk Test checks if data comes from a Normal Distribution. It is one of the most powerful normality tests.
: Data is Normal. : Data is Not Normal.
Sample Size
Best for
1. Python Implementation
from scipy import stats
stat, p = stats.shapiro(data)
if p < 0.05:
print("Not Normal (Reject H0)")
else:
print("Normal (Fail to Reject H0)")
2. R Implementation
# Built-in function
shapiro.test(data)
# If p < 0.05, consider non-parametric tests like Wilcoxon.