Andrew R. Kniss
2007-Jan-30 23:44 UTC
[R] lme : Error in y[revOrder] - Fitted : non-conformable arrays
Greetings R-helpers, I am attempting to fit an lme() while specifying a correlation structure, but I'm getting into trouble long before I get to that point. I am receiving the error: Error in y[revOrder] - Fitted : non-conformable arrays It doesn't seem to matter how simple or complex the model I specify is, it always gives this same error message. This makes me suspect something is wrong with my data set, but I'm not sure where to begin looking. I can run through the Pinheiro & Bates example on p.240 in a simplified form, so I know that everything with my installation (R v2.4.1; nlme v3.1-79; Windows XP) is working fine. However if I construct a groupedData object similar in form to the Ovary example, I will receive the same error, regardless of the model I specify. I can plot the groupedData object and get a figure very similar to Fig. 5.10 in Pinheiro & Bates. I have provided summarized output with a very simple lme() model, and the exact message. Any ideas on why the error is showing up and how I might correct it? #### Attempting to use my own data ####> groupedData(CHEAL~rel.year|blk,data=seed.cb[,c(5,1,7)])->cheal.grp > summary(cheal.grp)blk rel.year CHEAL I :36 Min. :0 Min. :15.96 II :36 1st Qu.:2 1st Qu.:56.70 III:36 Median :4 Median :70.76 IV :36 Mean :4 Mean :68.98 3rd Qu.:6 3rd Qu.:82.63 Max. :8 Max. :99.13> lme(CHEAL~rel.year,data=cheal.grp)->cheal.lmeError in y[revOrder] - Fitted : non-conformable arrays #### Everything works fine using the Pinheiro & Bates example #### on page 240 (in a simplified form)> summary(Ovary)Mare Time follicles 8 : 31 Min. :-0.1667 Min. : 1.00 4 : 29 1st Qu.: 0.1667 1st Qu.: 8.00 5 : 29 Median : 0.5000 Median :12.00 1 : 29 Mean : 0.5000 Mean :12.04 6 : 29 3rd Qu.: 0.8333 3rd Qu.:15.00 10 : 29 Max. : 1.1667 Max. :25.00 (Other):132> lme(follicles~Time,data=Ovary)->ovary.lme > summary(ovary.lme)Linear mixed-effects model fit by REML Data: Ovary AIC BIC logLik 1748.103 1770.445 -868.0515 Random effects: Formula: ~Time | Mare Structure: General positive-definite StdDev Corr (Intercept) 2.682827 (Intr) Time 3.787545 -0.159 Residual 3.783400 Fixed effects: follicles ~ Time Value Std.Error DF t-value p-value (Intercept) 10.86191 0.8828363 296 12.303430 0.0000 Time 2.28347 1.2719903 296 1.795194 0.0736 Correlation: (Intr) Time -0.27 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -2.74071048 -0.62051954 -0.05461339 0.70634887 2.70641284 Number of Observations: 308 Number of Groups: 11>Andrew Kniss University of Wyoming Department 3354 1000 E. University Ave. Laramie WY, 82071 Email: akniss at uwyo.edu Office: (307) 766-3949 Fax: (307) 766-5549