Learn R Programming

royston (version 1.2)

royston.test: Royston's Multivariate Normality Test

Description

A function to generate the Shapiro-Wilk's W statistic needed to feed the Royston's H test for multivariate normality

Usage

royston.test(a)

Arguments

a
A numeric matrix or data frame

Value

statistic
the value of Royston's H statistic at significance level 0.05
p.value
an approximate p-value for the test with respect to equivalent degrees of freedom (edf)

Details

If kurtosis of the data greater than 3 then Shapiro-Francia test is better for leptokurtic samples else Shapiro-Wilk test is better for platykurtic samples.

References

Johnson, R.A. and Wichern, D. W. (1992). Applied Multivariate Statistical Analysis. 3rd. ed. New-Jersey:Prentice Hall.

Mecklin, C.J. and Mundfrom, D.J. (2005). A Monte Carlo comparison of the Type I and Type II error rates of tests of multivariate normality. Journal of Statistical Computation and Simulation, 75:93-107.

Royston, J.P. (1982). An Extension of Shapiro and Wilks W Test for Normality to Large Samples. Applied Statistics, 31(2):115124.

Royston, J.P. (1983). Some Techniques for Assessing Multivariate Normality Based on the Shapiro-Wilk W. Applied Statistics, 32(2).

Royston, J.P. (1992). Approximating the Shapiro-Wilk W-Test for non-normality. Statistics and Computing, 2:117-119.121133.

Royston, J.P. (1995). Remark AS R94: A remark on Algorithm AS 181: The W test for normality. Applied Statistics, 44:547-551.

Shapiro, S. and Wilk, M. (1965). An analysis of variance test for normality. Biometrika, 52:591611.

Trujillo-Ortiz, A., R. Hernandez-Walls, K. Barba-Rojo and L. Cupul-Magana. (2007). Roystest:Royston's Multivariate Normality Test. A MATLAB file. URL http://www.mathworks.com/matlabcentral/fileexchange/17811

See Also

shapiro.test sf.test kurtosis mahalanobis qqplot qchisq

Examples

Run this code
a=iris[1:50,1:4] # Iris data only for setosa and four variables
royston.test(a)  # Data analyzed have a non-normal distribution.

#Variable 4 (petal width) is markedly non-normal. So when take off that variable;

dev.new()
a=iris[1:50,1:3] # Iris data only for setosa and three variables
royston.test(a)  # Data analyzed have a normal distribution.

Run the code above in your browser using DataLab