Homogeneity of Covariance Matrices MANOVA

39 views Asked by At

I am trying to compute the assumption for homogeneity of covariance in Rstudio using Box's M-test comparing four species with three different types of measurements.

This is what I tried,

#dataset
ID<- c(rep("A", times = 22), rep("B", times = 25), rep("C", times = 25), rep("D", times = 25)) 
Measurements1 <- c(rnorm(n=25, mean = 8), rnorm(n=25, mean = 6), rnorm(n=25, mean = 7.5), rnorm(n=22, mean = 4))
Measurements2 <- c(rnorm(n=25, mean = 4.5), rnorm(n=25, mean = 5.5), rnorm(n=25, mean = 6.5))
Measurements3 <- c(rnorm(n=25, mean = 2.5), rnorm(n=25, mean = 2.5), rnorm(n=25, mean = 3))

new_dataframe <- data.frame(cbind(ID, Measurements1, Measurements2, Measurements3))

#homogeneity of covariances
box_m(new_dataframe[, c("Measurements1", "Measurements2", "Measurements3")], new_dataframe$ID)

Instead of providing the values, it gives me N/A for statistics and p.values but gives me the parameter and method.

Thanks!

0

There are 0 answers