I am testing for multivariate normality in the Iris dataset. I want to compare the results of all the different tests under the MVN package (Mardia’s test, Henze-Zikler, Royston, Doornik-Hansen and Energy test) and have done the following code:
library(MVN)
library(htmlTable)
attach(iris)
#Mardia's Test
Mar<-MVN::mvn(data=iris,subset="Species", mvnTest="mardia")
Mar$multivariateNormality
#Henze-Zirkler's Test
Hz<-MVN::mvn(data=iris,subset="Species",mvnTest="hz")
Hz$multivariateNormality
#Royston's Test
Roy<-MVN::mvn(data=iris,subset="Species", mvnTest="royston")
Roy$multivariateNormality
#Doornik-Hansen Test
Dh<-MVN::mvn(data=iris,subset="Species", mvnTest="dh")
Dh$multivariateNormality
I have to get the results in a way that is easy to present in my findings. I am after three tables (one for each species) which summaries the data from the output above. Essentially for each table the rows are the different tests and the columns are the Test Statistic value, P Value and mvn Result. I tried the following
table <- rbind(Mar$multivariateNormality$setosa[1:2, ],Hz$multivariateNormality$setosa[1:2, ],Roy$multivariateNormality$setosa[1:2, ])
htmlTable(table, caption="Testing")
However, I get this error
Error in match.names(clabs, names(xi)) :
names do not match previous names