I am doing boxM test from biotools
R package to test the homogeneity of variance-covariance matrices. I am working on a dataset namely "wine" from r package called rattle
.
First, I installed the library(car)
. Then I did following conversions for all variables to prepare the dataset for LDA or QDA after Box's M test.
wine1 <- data.frame(wine)
wine1$Type <- as.factor(wine1$Type)
wine1$Alcohol <- as.numeric(wine1$Alcohol) # I converted all other variables to "numeric" class.
When I ran boxM test in RStudio [Version 0.99.489 and Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/601.5.17 (KHTML, like Gecko)] as
boxM(wine2[,-c(4, 11, 12, 13)], wine2[,1]) # No physical factors
boxM(wine2[,-c(2, 3, 5, 6, 7, 8, 9, 10, 14)], wine2[,1]) # No chemical factor
it returned following error
Error: is.numeric(x) || is.logical(x) is not TRUE
wine2
– IRTFM