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

Ben Bolker bbolker at gmail.com
Tue Dec 29 06:01:20 CET 2015


May we have a *reproducible* example please?  (All of your R code,
plus either your data set or a similar (or smaller) data set with the
SAS results corresponding to it ...)

On Mon, Dec 28, 2015 at 11:56 PM, Adeela Munawar <adeela.uaf at gmail.com> wrote:
> 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]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



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