swtest
R2026bDescription
returns a
test decision, using the Shapiro–Wilk test, for the null
hypothesis that the data in vector h = swtest(x)x comes from a normal distribution.
The alternative hypothesis is that the data does not come from such a distribution. The
result h is 1 if the test rejects the null hypothesis
at the 5% significance level, and 0 otherwise.
returns a test decision with additional options specified by one or more name-value
arguments. For example, you can change the significance level, or calculate the
p-value using a Monte Carlo approximation. h = swtest(x,Name=Value)
Tip
It is recommended that you specify MonteCarloTolerance when the
sample data x contains more than 5000 values.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
More About
References
[1] Royston, Patrick. “Remark AS R94: A Remark on Algorithm AS 181: The W-Test for Normality.” Applied Statistics 44, no. 4 (1995): 547. https://doi.org/10.2307/2986146.
[2] Shapiro, S. S., and M. B. Wilk. “An Analysis of Variance Test for Normality (Complete Samples).” Biometrika 52, nos. 3–4 (1965): 591–611. https://doi.org/10.1093/biomet/52.3-4.591.
Version History
Introduced in R2026b
See Also
adtest | jbtest | kstest | lillietest | rjtest