Shapiro_Wilk_test: Shapiro-Wilk Normality Test

Description Usage Arguments Details Value References Examples

View source: R/normal_assumption.R

Description

Performs the Shapiro-Wilk test for normality.

Usage

1

Arguments

X

a single numeric vector of data values, the number of observations must be between 3 and 5000.

Details

The Shapiro-Wilk test is a statistical significance test that tests the hypothesis that the underlying population of a sample is normally distributed. The test was developed by Samuel Shapiro and Martin Wilk and first presented in 1965. The null hypothesis H0 assumes that there is a normal distribution of the population. On the other hand, the alternative hypothesis H1 that there is no normal distribution. If the value of the test statistic W is greater than the critical value Wcritical, the null hypothesis is not rejected, and a normal distribution is assumed. Alternatively, if the p-value of the test is determined, the null hypothesis is usually not rejected if the p-value is greater than the specified significance level alpha. The test can be used to check univariate samples with 3 to 5000 observations. In addition to other known tests for normal distribution, such as the Kolmogorov-Smirnow test or the Chi-square test, the Shapiro-Wilk test is distinguished by its comparatively high-test strength in numerous test situations, especially when testing smaller samples with n<50.

Value

An htest object is returned. The critical value and the p-value are contained in the object.

References

Sam S. Shapiro, Martin Bradbury Wilk: An analysis of variance test for normality (for complete samples), Biometrika, 52(3/4), 1965, pp. 591–611, doi:10.1093/biomet/52.3-4.591, JSTOR 2333709.

Patrick Royston (1982). An extension of Shapiro and Wilk's W test for normality to large samples. Applied Statistics, 31, 115–124. doi: 10.2307/2347973.

Patrick Royston (1982). Algorithm AS 181: The W test for Normality. Applied Statistics, 31, 176–180. doi: 10.2307/2347986.

Patrick Royston (1995). Remark AS R94: A remark on Algorithm AS 181: The W test for normality. Applied Statistics, 44, 547–551. doi: 10.2307/2986146.

Examples

1
2
3
4
5
6
7
8
## Not run: 
z <- rnorm(100)
olsdiagnosticR:::Shapiro_Wilk_test(X = z)

y <- rexp(100)
olsdiagnosticR:::Shapiro_Wilk_test(X = y)

## End(Not run)

Kale-S/isnormalr documentation built on Sept. 23, 2019, 5:48 a.m.