rmavenmultivariate-testingiris-dataset

How to fix the error "argument "modelName" is missing, with no default" when using MVN package


I am using the MVN package, in R, to find whether each class of the dataset iris is multivariate normal or not. I used the below code earlier in the day and generated results from it. However, I went to revisit it and now keep getting the following error message:

Error in mvn(data = iris[Species == m[1], 1:4], mvnTest = c("mardia")) : 
  argument "modelName" is missing, with no default

Can not figure out what this means and how to fix it !

Code:

#Mardia's Test
SM<-mvn(data=iris,subset="Species", mvnTest="mardia")

SM$multivariateNormality

SetosaPlot<-mvn(data=iris, subset="Species", multivariatePlot="qq")

Solution

  • You loaded the mclust package. When you did so you should have seen a warning

    The following object is masked from ‘package:MVN’: mvn

    So now mvn() is calling mclust::mvn() (i.e. the mvn function in the mclust package) rather than MVN::mvn().

    MVN::mvn(data=iris, subset="Species", multivariatePlot="qq")
    

    (By the way, no real data set is ever truly multivariate normal; you're not testing "whether it is MVN or not", but rather whether it is close enough to MVN that you can't reject the null hypothesis of multivariate normality ...)