Skip to content
Prev 13867 / 20628 Next

contrasts among simple effects

Dear Russell,

Your assistance is appreciated. However, the code below returns an error
message. Maybe my model is inappropriate. It was necessary to remove the
ordered statement [ordered(time)], because apparently with the ordered
statement lsmeans did not read time as a factor.

library("nlme")

# with AR1 variance/covariance structure

heartRate$time <- factor(heartRate$time)

model2a <- lme(HR ~ drug*time, random =~1|person, correlation
=corAR1(form=~1|person), data = heartRate)

summary(model2a)

library("lsmeans")

anova(model2a)

lsm <- lsmeans(model2a, ~ drug|time)

lsm

Error in format.default(nm[j], width = nchar(m[1, j]), just = "left") :

  4 arguments passed to .Internal(nchar) which requires 3



pairs(lsm)

pairs(lsm, by = "drug")



The Using lsmeans tutorial (Oct 9, 2015) illustrates the usefulness of the
lsmeans package.

Best regards,

James F. Henson

On Mon, Oct 19, 2015 at 1:39 AM, Thierry Onkelinx <thierry.onkelinx at inbo.be>
wrote: