\HeaderA{shapiro.test}{Shapiro-Wilk Normality Test}{shapiro.test}
\keyword{htest}{shapiro.test}
\begin{Description}\relax
Performs the Shapiro-Wilk test of normality.
\end{Description}
\begin{Usage}
\begin{verbatim}
shapiro.test(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a numeric vector of data values. Missing values are allowed,
but the number of non-missing values must be between 3 and 5000.
\end{ldescription}
\end{Arguments}
\begin{Value}
A list with class \code{"htest"} containing the following components:
\begin{ldescription}
\item[\code{statistic}] the value of the Shapiro-Wilk statistic.
\item[\code{p.value}] an approximate p-value for the test.  This is
said in Royston (1995) to be adequate for \code{p.value < 0.1}.
\item[\code{method}] the character string \code{"Shapiro-Wilk normality test"}.
\item[\code{data.name}] a character string giving the name(s) of the data.
\end{ldescription}
\end{Value}
\begin{Source}\relax
The algorithm used is a C translation of the Fortran code described in
Royston (1995) and found at \url{http://lib.stat.cmu.edu/apstat/R94}.
The calculation of the p value is exact for \eqn{n = 3}{}, otherwise
approximations are used, separately for \eqn{4 \le n \le 11}{} and
\eqn{n \ge 12}{}.
\end{Source}
\begin{References}\relax
Patrick Royston (1982)
An extension of Shapiro and Wilk's \eqn{W}{} test for normality to large
samples.
\emph{Applied Statistics}, \bold{31}, 115--124.

Patrick Royston (1982)
Algorithm AS 181: The \eqn{W}{} test for Normality.
\emph{Applied Statistics}, \bold{31}, 176--180.

Patrick Royston (1995)
Remark AS R94: A remark on Algorithm AS 181: The \eqn{W}{} test for normality.
\emph{Applied Statistics}, \bold{44}, 547--551.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{qqnorm}{qqnorm}} for producing a normal quantile-quantile plot.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
shapiro.test(rnorm(100, mean = 5, sd = 3))
shapiro.test(runif(100, min = 2, max = 4))
\end{ExampleCode}
\end{Examples}

