Description Usage Arguments Value References See Also Examples
The SWT-based tests for multivariate normality including Royston's H test and the test proposed by Villasenor-Alva and Gonzalez-Estrada (2009).
1 | msw(X)
|
X |
an n*p numeric matrix or data frame, the number of n must be between 3 and 5000, n>p. |
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 if n > 2000 or n < 3 and the test results
of Villasenor-Alva and Gonzalez-Estrada (VAGE
) will not be reported if n > 5000 or n < 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.
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.
power.mswR
, power.mswV
, mvnTest
, faTest
, msk
, mardia
, mhz
, mvn
, shapiro.test
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.