msw {mvnormalTest} | R Documentation |
Shapiro-Wilk Type (SWT) Tests for Multivariate Normality
Description
The SWT-based tests for multivariate normality including Royston's H test and the test proposed by Villasenor-Alva and Gonzalez-Estrada (2009).
Usage
msw(X)
Arguments
X |
an |
Value
Returns a list with two objects:
mv.test
a result table of multivariate normality tests, including the name of the test, test statistic, p-value, and multivariate normality summary (Yes, if p-value>0.05). Note that the test results of
Royston
will not be reported ifn > 2000
orn < 3
and the test results of Villasenor-Alva and Gonzalez-Estrada (VAGE
) will not be reported ifn > 5000
orn < 12
.uv.shapiro
a dataframe with
p
rows detailing univariate Shapiro-Wilk tests. Columns in the dataframe contain test statistics W, p-value,and univariate normality summary (YES, if p-value>0.05).
If the number of variable is p=1
, only univariate Shapiro-wilk's test result will be produced.
References
Shapiro, S. S., & Wilk, M. B. (1965). An analysis of variance test for normality (complete samples). Biometrika, 52(3/4), 591-611.
Royston, J. P. (1982). An extension of Shapiro and Wilk's W test for normality to large samples. Journal of the Royal Statistical Society: Series C (Applied Statistics), 31(2), 115-124.
Villasenor Alva, J. A., & Estrada, E. G. (2009). A generalization of Shapiro–Wilk's test for multivariate normality. Communications in Statistics—Theory and Methods, 38(11), 1870-1883.
Lee, R., Qian, M., & Shao, Y. (2014). On rotational robustness of Shapiro-Wilk type tests for multivariate normality. Open Journal of Statistics, 4(11), 964.
See Also
power.mswR
, power.mswV
, mvnTest
, faTest
, msk
, mardia
, mhz
, mvn
, shapiro.test
Examples
set.seed(12345)
## Data from gamma distribution
X = matrix(rgamma(50*4,shape = 2),50)
msw(X)
## Data from normal distribution
X = matrix(rnorm(50*4,mean = 2 , sd = 1),50)
msw(X)
## load the ubiquitous multivariate iris data ##
## (first 50 observations of columns 1:4) ##
iris.df = iris[1:50, 1:4]
msw(iris.df)