Skip to content
Prev 261529 / 398502 Next

different results from lme() and lmer()

Dear Miya,

Notice the very strong negative correlation between the random intercept and the random slope in the lme() model. That is usually an indication of problems (in this case overfitting). If you drop the random slope, then both models yield the same parameters.

Plotting the data reviels a much better model specification.

dat <- read.table(file = "http://www.bio.ic.ac.uk/research/mjcraw/therbook/data/fertilizer.txt", header = TRUE)
library(ggplot2)
ggplot(dat, aes(x = week, y = root, group = plant, colour = fertilizer)) + geom_line()

lmer(root~fertilizer + week +(1|plant),data=dat)

Best regards,

Thierry

PS Use R-sig-mixedmodels for questions on mixed models