Learn R Programming

goft (version 1.3.6)

normal_test: Test for normality

Description

Correlation test of fit for normality based on the Levy characterization (Villasenor-Alva and Gonzalez-Estrada, 2015).

Usage

normal_test(x, method = "cor")

Arguments

x

a numeric data vector containing a random sample of size n.

method

a character string giving the name of the test to be used. So far the only option is "cor".

Value

A list with class "htest" containing the following components.

statistic

the calculated value of the test statistic.

p.value

an approximated p-value of the test.

method

the character string "Correlation test for normality".

data.name

a character string giving the name of the data set.

Details

Sample size (n) must be an integer lying between 10 and 400.

The Levy characterization of the normal distribution states that sums of independent normal random variables are also normal random variables. Based on this property, the normality assumption might be judged by comparing sums of pairs of observations from a random sample to quantiles of the standard normal distribution. If normality holds then the pairs of sums and quantiles should lie on a straight line approximately. A formal test for normality is obtained when such a comparison is based on the sample correlation coefficient of sums and quantiles.

References

Villasenor-Alva, J.A. and Gonzalez-Estrada, E. (2015). A correlation test for normality based on the Levy characterization. Communications in Statistics: Simulation and Computation, 44 5, 1225-1238. http://dx.doi.org/10.1080/03610918.2013.810261

See Also

shapiro.test

Examples

Run this code
# NOT RUN {
data(goats)                   # loading the "goats" data set
apply(goats,2,normal_test)    # testing normality on each variable of the "goats" data set    
# }

Run the code above in your browser using DataLab