View source: R/Shapiro_Wilk_test.R
| Shapiro_Wilk_test | R Documentation |
Performs the Shapiro–Wilk normality test, which assesses whether a sample originates from a normally distributed population using a regression-based correlation method.
Shapiro_Wilk_test(
x,
alpha = 0.05,
method = c("SWR", "SF", "SW"),
silent = FALSE,
summary = TRUE,
misc = FALSE,
resampling = TRUE
)
x |
A numeric vector. |
alpha |
Significance threshold (default: 0.05). |
method |
Character (default: "SWR"). Use which modification of the test? Available options are c("SWR", "SF", "SW"). |
silent |
Logical (default: FALSE). If |
summary |
Logical (default: TRUE). Produce a summary table. |
misc |
Logical (default: FALSE). Output other unimportant parameters. |
resampling |
Logical (default: TRUE).
If |
method
"SW": Shapiro–Wilk test, the original normality test proposed by Shapiro and Wilk (1965). Applicable only for sample sizes 3 <= n <= 50.
"SF": Shapiro–Francia test, proposed by Shapiro and Francia (1972) and subsequently simplified and extended by Royston (1993). Applicable only for sample sizes 5 <= n <= 5000.
"SWR": Shapiro–Wilk test with Royston's (1992) modifications for approximating the null distribution and extending the test to larger sample sizes. Applicable only for sample sizes 3 <= n <= 5000.
A list.
Shapiro, S.S., Wilk, M.B., 1965. An Analysis of Variance Test for Normality (Complete Samples). Biometrika 52, 591–611. https://doi.org/10.2307/2333709
Shapiro, S.S., Francia, R.S., 1972. An Approximate Analysis of Variance Test for Normality. J. Am. Stat. Assoc. 67, 215–216. https://doi.org/10.1080/01621459.1972.10481232
Royston, P., 1993. A pocket-calculator algorithm for the Shapiro–Francia test for non-normality: an application to medicine. Stat. Med. 12, 181–184. https://doi.org/10.1002/sim.4780120209
Royston, P., 1992. Approximating the Shapiro–Wilk W-test for non-normality. Stat. Comput. 2, 117–119. https://doi.org/10.1007/BF01891203
sw <- Shapiro_Wilk_test(rnorm(20), method = "SW")
print(sw$summary)
sf <- Shapiro_Wilk_test(rnorm(100) ^ 2, method = "SF")
print(sf$summary)
swr <- Shapiro_Wilk_test(rnorm(1e6), method = "SWR")
print(swr$summary)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.