shapiro.test
ShapiroWilk Normality Test
Performs the ShapiroWilk test of normality.
 Keywords
 htest
Usage
shapiro.test(x)
Arguments
 x
 a numeric vector of data values. Missing values are allowed, but the number of nonmissing values must be between 3 and 5000.
Value

A list with class
 statistic
 the value of the ShapiroWilk statistic.
 p.value
 an approximate pvalue for the test. This is
said in Royston (1995) to be adequate for
p.value < 0.1
.  method
 the character string
"ShapiroWilk normality test"
.  data.name
 a character string giving the name(s) of the data.
"htest"
containing the following components:
Source
The algorithm used is a C translation of the Fortran code described in Royston (1995) and found at http://lib.stat.cmu.edu/apstat/R94. The calculation of the p value is exact for $n = 3$, otherwise approximations are used, separately for $4 \le n \le 11$ and $n \ge 12$.
References
Patrick Royston (1982) An extension of Shapiro and Wilk's $W$ test for normality to large samples. Applied Statistics, 31, 115124.
Patrick Royston (1982) Algorithm AS 181: The $W$ test for Normality. Applied Statistics, 31, 176180.
Patrick Royston (1995) Remark AS R94: A remark on Algorithm AS 181: The $W$ test for normality. Applied Statistics, 44, 547551.
See Also
qqnorm
for producing a normal quantilequantile plot.
Examples
library(stats)
shapiro.test(rnorm(100, mean = 5, sd = 3))
shapiro.test(runif(100, min = 2, max = 4))