% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gmeans.R
\name{ad.test}
\alias{ad.test}
\title{Anderson-Darling Normality Test}
\source{
Adapted from \code{\link[nortest:ad.test]{nortest::ad.test()}}
}
\usage{
ad.test(x)
}
\arguments{
\item{x}{(\code{numeric()})\cr
Vector of data values. Missing values are allowed, but the
number of non-missing values must be greater than 7.}
}
\value{
A list inheriting from classes \code{"htest"} containing the following components:
\itemize{
\item statistic: the value of the statistic.
\item p.value: the p-value of the test.
\item method: the character string \code{"Anderson-Darling normality test"}.
\item data.name: a character string giving the name(s) of the data.
}
}
\description{
Perform the Anderson-Darling normality test.
}
\details{
The Anderson-Darling test is an EDF omnibus test for the composite hypothesis of
normality. The test statistic is \deqn{
  A^2 = -n -\frac{1}{n} \sum_{i=1}^{n} (2i - 1) [\ln(z_{i}) + \ln(1 - z_{n + 1 - i})]
}
where \eqn{z_{i} = \Phi(\frac{x_{i} - \bar{x}}{s})}. Here,
\eqn{\Phi} is the cumulative distribution function of the standard normal
distribution, and \eqn{\bar{x}} and \eqn{s} are mean and standard deviation of
the data values. The p-value is computed from the modified statistic
\eqn{A^2_*=A^2 (1.0 + 0.75/n + 2.25/n^{2})} according to Table 4.9 in
Stephens (1986).
}
\examples{
set.seed(123)
ad.test(rnorm(100, mean = 5, sd = 3))
ad.test(runif(100, min = 2, max = 4))
}
\references{
Stephens, A. M (1986).
\dQuote{Goodness-of-Fit-Techniques.}
In D'Agostino, B. R (eds.), chapter Tests based on EDF statistics.
CRC Press.

Thode, C. H (2002).
\emph{Testing for normality}, 1 edition.
CRC Press.
\doi{10.1201/9780203910894}.
}
\seealso{
\code{\link[stats:shapiro.test]{stats::shapiro.test()}} for performing the Shapiro-Wilk test for normality.
\code{\link[nortest:cvm.test]{nortest::cvm.test()}}, \code{\link[nortest:lillie.test]{nortest::lillie.test()}}, \code{\link[nortest:pearson.test]{nortest::pearson.test()}},
\code{\link[nortest:sf.test]{nortest::sf.test()}} for performing further tests for normality.
\code{\link[stats:qqnorm]{stats::qqnorm()}} for producing a normal quantile-quantile plot.
}
