[R] R lmer & SAS glimmix
Bert Gunter
gunter.berton at gene.com
Mon Nov 12 16:47:44 CET 2012
It's due to the different coding of contrasts. Post to R-sig-mixed
models for a fuller explanation (though it has nothing to do with
mixed models; the same would happen with lm) or search on a suitable
phrase (e.g. contrast coding in SAS versus R) in R archives or via
google etc.
-- Bert
On Mon, Nov 12, 2012 at 6:40 AM, Sophie GUERIN <s.guerin at has-sante.fr> wrote:
> Hi,
>
> I am trying to fit a model with lmer in R and proc glimmix in SAS. I have
> simplified my code but I am surprised to see I get different results from
> the two softwares.
>
> My R code is :
> lmer(y~age_cat + (1|cat),data=fic,family=binomial(link = "logit"), NaGQ=1)
>
> My SAS code is :
> ods output Glimmix.Glimmix.ParameterEstimates=t_estimates;
> proc glimmix data=tab_psi method=laplace;
> class age_cat cat;
> model psi (event='1') = age_cat / solution dist=B link=logit ;
> random intercept / subject=cat;
> run;
>
> >From R, I get the following fixed effects
> (Intercept) age_cat2. 76-85 ans age_cat3. 66-75 ans age_cat4. 41-65 ans
> -3.5766898 -0.0159466 -0.1919500 -0.4834741
> age_cat5. 18-40 ans
> -1.2843977
>
> But from SAS I get :
> Valeur Erreur Valeur
> Effet age_cat estimée type DDL du
> test t Pr > |t|
>
> Intercept -4.8608 0.2859 3 -17.00
> 0.0004
> age_cat 1. >85-108 a 1.2841 0.2589 168E3 4.96
> <.0001
> age_cat 2. 76-85 ans 1.2681 0.2528 168E3 5.02
> <.0001
> age_cat 3. 66-75 ans 1.0921 0.2529 168E3 4.32
> <.0001
> age_cat 4. 41-65 ans 0.8006 0.2535 168E3 3.16
> 0.0016
> age_cat 5. 18-40 ans 0 . . .
> .
>
> Even the intercept is different, but I can't find why. Has anyone an idea?
>
> Thanks in advance,
>
> Sophie
> [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Bert Gunter
Genentech Nonclinical Biostatistics
Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
More information about the R-help
mailing list