norm.1965SW: Univariate Test of Normality by Shapiro and Wilk (1965)

View source: R/norm_1965SW.R

norm.1965SWR Documentation

Univariate Test of Normality by Shapiro and Wilk (1965)

Description

Given an univariate sample x, it tests

H_0 : x\textrm{ is from normal distribution} \quad vs\quad H_1 : \textrm{ not } H_0

using a test procedure by Shapiro and Wilk (1965). Actual computation of p-value is done via an approximation scheme by Royston (1992).

Usage

norm.1965SW(x)

Arguments

x

a length-n data vector.

Value

a (list) object of S3 class htest containing:

statistic

a test statistic.

p.value

p-value under H_0.

alternative

alternative hypothesis.

method

name of the test.

data.name

name(s) of provided sample data.

References

\insertRef

shapiro_analysis_1965SHT

\insertRef

royston_approximating_1992SHT

Examples

## generate samples from several distributions
x = stats::runif(28)            # uniform
y = stats::rgamma(28, shape=2)  # gamma
z = stats::rlnorm(28)           # log-normal

## test above samples
test.x = norm.1965SW(x) # uniform
test.y = norm.1965SW(y) # gamma
test.z = norm.1965SW(z) # log-normal


kisungyou/SHT documentation built on Oct. 15, 2022, 3:18 p.m.