mvShapiro.Test: Shapiro-Wilk test for multivariate normality

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

A generalization of Shapiro-Wilk test for multivariate normality (Villasenor-Alva and Gonzalez-Estrada, 2009).

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 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))

Example output

Loading required package: fitdistrplus
Loading required package: MASS
Loading required package: survival
Loading required package: npsurv
Loading required package: lsei

	Generalized Shapiro-Wilk test for Multivariate Normality

data:  iris.virginica
MVW = 0.98521, p-value = 0.9652


	Generalized Shapiro-Wilk test for Multivariate Normality

data:  as.matrix(goats)
MVW = 0.96649, p-value = 0.01684

goft documentation built on July 1, 2020, 5:56 p.m.

Related to mvShapiro.Test in goft...