At the risk of this being a somewhat vague question, I am going ahead and ask it anyways:
I am running a multivariate regression in R with two outcome variables and would like to assess the homogeneity of covariance matrices, but, alas, the Kullback test throws an error:
Error in cov(Y[X == lev.X[k], ]) :
supply both 'x' and 'y' or a matrix-like 'x'
Now, both x and y are matrices, so I really don't know what to do and would appreciate any kind of input.
library(psych)
y <- cbind(health_demo.z$years.of.life.lost.to.communicable.diseases......2002, health_demo.z$years.of.life.lost.to.non.communicable.diseases......2002)
x <- as.matrix(health_demo.z$population.in.urban.areas....)
Kullback(y, x)
head(x)
[,1]
[1,] -0.6723010
[2,] 1.4475329
[3,] 1.3543534
[4,] 0.3526736
[5,] -1.6040962
[6,] 0.6089173
head(y)
[,1] [,2]
[1,] -0.5076484 0.3191182
[2,] -0.4722119 0.4345915
[3,] -0.9328864 0.8579938
[4,] -1.0037594 1.0889405
[5,] 1.0161210 -1.0280708
[6,] -0.8620134 0.5115738
I hope that helps illustrate the problem.