[R] SAS "/slice" and "/diff" equivalent? - Automated multiple comparisons in nlme package?
danielreispereira at gmail.com
Mon Dec 13 07:08:36 CET 2010
What is the equivalent of SAS " '/diff' and '/slice'" in R ?
I am successful in fitting the same model "PROC MIXED" fits using lme() :
model <- lme( y ~ g + h + yr + yr:h, random = ~ 1 | b, data = yield)
*** SAS code:
proc mixed data=yield covtest cl method=reml;
class b g h yr;
model y = g h yr yr*h;
lsmeans g / diff;
The codes above give equivalent outputs (analysis of a 5(g) by 2(h)
factorial, RCBD(b)), except for the "lsmeans g / diff" line, which I
cannot reproduce in R!
The below gives one of the comparisons I am looking for.
anova(model, L=c("gPEN"=1, "gC5"=-1))
Is there a command to automate such thing? I understand from
the issues with "lsmeans" (this is *not* what I am trying to get here!
). I am just trying to get all possible pairwise comparisons from one
simple command. Already checked the "effects package" but it did not
work with a lme() object.
Thanks in advance, Daniel
More information about the R-help