mvshapiro_test {goft} | R Documentation |
Shapiro-Wilk test for multivariate normality
Description
A generalization of Shapiro-Wilk test for multivariate normality (Villasenor-Alva and Gonzalez-Estrada, 2009).
Usage
mvshapiro_test(X)
Arguments
X |
a numeric data matrix with d columns and n rows. |
Details
Sample size (n) must be larger than vector dimension (d).
When d = 1, mvshapiro_test(X)
produces the same results as shapiro.test(X)
.
Value
A list with class "htest"
containing the following components.
statistic |
the value of the generalized Shapiro-Wilk statistic for testing multivariate normality. |
p.value |
an approximated p-value of the test. |
method |
the character string "Generalized Shapiro-Wilk test for multivariate normality". |
data.name |
a character string giving the name of the data set. |
Author(s)
Elizabeth Gonzalez-Estrada egonzalez@colpos.mx, Jose A. Villasenor-Alva
References
Villasenor-Alva, J.A. and Gonzalez-Estrada, E. (2009). A generalization of Shapiro-Wilk's test for multivariate normality. Communications in Statistics: Theory and Methods, 38 11, 1870-1883. http://dx.doi.org/10.1080/03610920802474465
See Also
shapiro.test
and normal_test
for testing univariate normality.
Examples
# Example 1: Testing multivariate normality on iris.virginica
# iris.virginica contains a set of measurements corresponding to
# Iris virginica of famous iris data set.
iris.virginica <- as.matrix(iris[iris$Species == "virginica", 1:4], ncol = 4)
mvshapiro_test(iris.virginica)
# Example 2: Testing multivariate normality on the goats dataset
data(goats)
mvshapiro_test(as.matrix(goats))