lme : Error in y[revOrder] - Fitted : non-conformablearrays
On Thu, 24 Feb 2011, Martha Ellis wrote:
tmp <-
structure(list(V1 = c(2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 5L, 5L, 5L, 5L, 5L, 4L, 1L), V2 = structure(c(1.010223,
1.0373085, 1.0709125, 1.019632, 1.032068, 1.120029, 1.3602485,
0.9572956, 1.0438845, 1.07723, 1.232857, 1.2246855, 1.008405,
1.037069, 1.109897, 1.0617635, 0.99650495, 1.0230875, 1.0483565,
1.073022, 1.035214, 0.9967045), .Dim = 22L), V3 = c(4.214007,
3.679315, 7.123898, 3.315951, 1.81672, 4.032529, 3.095994, 2.084266,
2.685965, 2.365525, 3.41177, 6.487154, 1.604934, 3.478011, 3.614858,
3.085864, 1.979418, 4.055808, 4.122687, 3.901821, 1.75092, 1.207486
)), .Names = c("V1", "V2", "V3"), row.names = c(NA, -22L), class =
"data.frame")
Well, V2 is the sticking point. lme is failing when it has to carry out a "vector" by "matrix" subtraction: y[revOrder] - Fitted, where y is 1:22(1d) and Fitted is a 22*2 matrix. z <- as.numeric(tmp$V2) z - z # OK tmp$V2 - z # OK z - cbind(z,z) # OK tmp$V2 - cbind(z,z) # nonconformable So, not a problem in lme per se.
| David Duffy (MBBS PhD) ,-_|\ | email: davidD at qimr.edu.au ph: INT+61+7+3362-0217 fax: -0101 / * | Epidemiology Unit, Queensland Institute of Medical Research \_,-._/ | 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v