[R] Hotelling T-test in R - error?

stephalope stephalope at gmail.com
Sun Feb 21 17:41:25 CET 2010


Hey there,

I am trying to do a series of hotelling t-tests in R. But I keep getting the
following error:

> mat <-
> cbind(Dataset$Ula.l.sl1A,Dataset$incisordepth.residuals,Dataset$lclhm.residuals,Dataset$lclpsl2.residuals,Dataset$llaheight.residuals,Dataset$llas.residuals,Dataset$lm3.m1,Dataset$lmheight.residuals,Dataset$ucllalia.residuals,Dataset$uclppr.residuals,Dataset$ulaah.residuals,Dataset$ulm3.residuals,Dataset$um3.m1,Dataset$umah.residuals,Dataset$uprheight.residuals)
> # Hotelling T2 test for grps 1 & 2
> T2.test(mat[which(as.factor(Dataset$diet)==levels(as.factor(Dataset$diet))[1]),],mat[which(as.factor(Dataset$diet)==levels(as.factor(Dataset$diet))[2]),])
Error in drop(.Call("La_dgesv", a, as.matrix(b), tol, PACKAGE = "base")) : 
  system is computationally singular: reciprocal condition number =
5.39931e-21

I am not sure what is going on but I assume it has to do with the matrix
math? I have 6 groups, and some of them will work, and others I get this
error. Does this have to do with group size? I am running the t-test using
15 variables, when I run the ttest w/ 7 (despite which 7 I choose) the test
will run fine for all 6 groups. What do you think could be causing this? 

Thanks,
Stephanie
-- 
View this message in context: http://n4.nabble.com/Hotelling-T-test-in-R-error-tp1563584p1563584.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list