V.mat {asbio} | R Documentation |
Calculates a pooled covariances matrix ala legendre and Legendre (1998). This is required for a number of multivariate procedures including the Kullback statistic for multivariate homoscedasticity, and Hotelling's test.
V.mat(Y, X)
Y |
An n x p matrix of quantative dependent variables. |
X |
A n x 1 of categorical groups (e.g. factor levels). |
Ken Aho
Legendre, P, and L. Legendre (1998) Numerical ecology, 2nd English edition. Elsevier, Amsterdam, The Netherlands.
Y1<-rnorm(100,12,2) Y2<-rnorm(100,14,2) X<-c(rep(1,50),rep(2,50)) V.mat(cbind(Y1,Y2),X)