[R-sig-ME] different output in R and SAS for GLMM

Adeela Munawar adeela.uaf at gmail.com
Tue Dec 29 05:56:54 CET 2015


Dear all,

I am comparing the output of SAS and R for generalized linear mixed models
with gamma family. Code for SAS are

proc glimmix data=ch12_ex1 plot=residualpanel(ilink) noprofile;
 class block a b;
 model days=a|b / d=gamma;
 random intercept a/subject=block;
 lsmeans a*b / slicediff=(a b) ilink cl;
 covtest /cl(type=plr);

while I am fitting this using lme4 package as
a<-factor(a)
b<-factor(b)
block<-factor(block)

ModelGamma <- glmer(days~a*b+(1|block/a),family=Gamma(link = "log"))
 lsmeans(ModelGamma,~a*b)

but the results are altogether different. SAS gives 9 df while NA in R and
least sqaure means are also different.

a b   lsmean        SE      df   asymp.LCL asymp.UCL
 1 1 3.212923 0.5677001 NA  2.100251  4.325595
 2 1 3.229803 0.5662713 NA  2.119932  4.339675
 3 1 3.279271 0.5688496 NA  2.164346  4.394196
 1 2 2.499457 0.5679181 NA  1.386358  3.612556
 2 2 3.248968 0.5659105 NA  2.139804  4.358132
 3 2 3.563672 0.5689044 NA  2.448640  4.678705

Why this happens? Please suggest.

Thanks,
Adeela

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list