[R] Setting base level for contrasts with lme

Marcin Kozak nyggus at gmail.com
Thu Jan 28 17:45:08 CET 2010


Hi all,

Note:
lm(Yield ~ Block + C(Variety, base = 2), Alfalfa)

equals
i <- 2; lm(Yield ~ Block + C(Variety, base = i), Alfalfa)

However,
lme(Yield ~ C(Variety, base = 2), Alfalfa, random=~1|Block)

which is fine, does not equal
i <- 2; lme(Yield ~ C(Variety, base = i), Alfalfa, random=~1|Block)
after which I get the message
"Error in model.frame.default(formula = ~Yield + Variety + i + Block,
data = list( :  variable lengths differ (found for 'i')"

Is everything fine with that?

Regards,
Marcin



More information about the R-help mailing list