Description Usage Arguments Details Value Author(s) References See Also Examples
Correlation test of fit for normality based on the Levy characterization (Villasenor-Alva and Gonzalez-Estrada, 2015).
1 | normal_test(x, method = "cor")
|
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 |
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.
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. |
Elizabeth Gonzalez-Estrada egonzalez@colpos.mx, Jose A. Villasenor-Alva
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
1 2 | data(goats) # loading the "goats" data set
apply(goats,2,normal_test) # testing normality on each variable of the "goats" data set
|
Loading required package: fitdistrplus
Loading required package: MASS
Loading required package: survival
Loading required package: npsurv
Loading required package: lsei
$body.weight
Correlation test for normality
data: newX[, i]
R = 0.99493, p-value = 0.08603
alternative hypothesis: newX[, i] does not follow a normal distribution.
$body.length
Correlation test for normality
data: newX[, i]
R = 0.9976, p-value = 0.2957
alternative hypothesis: newX[, i] does not follow a normal distribution.
$trunk.length
Correlation test for normality
data: newX[, i]
R = 0.99482, p-value = 0.08242
alternative hypothesis: newX[, i] does not follow a normal distribution.
$withers.height
Correlation test for normality
data: newX[, i]
R = 0.99779, p-value = 0.3296
alternative hypothesis: newX[, i] does not follow a normal distribution.
$thoracic.perimeter
Correlation test for normality
data: newX[, i]
R = 0.99914, p-value = 0.7295
alternative hypothesis: newX[, i] does not follow a normal distribution.
$hip.length
Correlation test for normality
data: newX[, i]
R = 0.99555, p-value = 0.1111
alternative hypothesis: newX[, i] does not follow a normal distribution.
$ear.length
Correlation test for normality
data: newX[, i]
R = 0.99779, p-value = 0.3281
alternative hypothesis: newX[, i] does not follow a normal distribution.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.