mvnTest {mvnormalTest} | R Documentation |
A Powerful Test for Multivariate Normality (Zhou-Shao's Test)
Description
A simple and powerful test for multivariate normality with a combination of multivariate
kurtosis (MK) and Shapiro-Wilk which was proposed by Zhou and Shao (2014). The p-value of the test
statistic (T_n
) is computed based on a simulated null distribution of T_n
. Details see Zhou and Shao (2014).
Usage
mvnTest(X, B = 1000, pct = c(0.01, 0.99))
Arguments
X |
an |
B |
number of Monte Carlo simulations for null distribution, default is 1000 (increase B to increase the precision of p-value). |
pct |
percentiles of MK to get |
Value
Returns a list with two objects:
mv.test
results of the Zhou-Shao's test for multivariate normality , i.e., test statistic
T_n
, p-value (under H0, i.e. multivariate normal, thatT_n
is at least as extreme as the observed value), and multivariate normality summary (YES, if p-value>0.05).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).
References
Zhou, M., & Shao, Y. (2014). A powerful test for multivariate normality. Journal of applied statistics, 41(2), 351-363.
Shapiro, S. S., & Wilk, M. B. (1965). An analysis of variance test for normality (complete samples). Biometrika, 52(3/4), 591-611.
See Also
power.mvnTest
, msk
, mardia
, msw
, faTest
, mhz
Examples
set.seed(12345)
## Data from gamma distribution ##
X = matrix(rgamma(50*4,shape = 2),50)
mvnTest(X, B=100)
## load the ubiquitous multivariate iris data ##
## (first 50 observations of columns 1:4) ##
iris.df = iris[1:50, 1:4]
mvnTest(iris.df, B=100)