R lmer and SAS PROC GLIMMIX for multilevel linear modeling and logistic modeling

The following R and SAS syntaxes returned almost identical results.  (I was a bit surprised that they used almost identical degree of freedom - where group variables uses the n of groups minus something.)

LINEAR MODELING

R:

library(lme4)

kaz1 <- lmer(formula=SAT_TOTAL ~ treat + pretest_GPA + male + minority + disadv + (1|group_school),
data= sas_data_Sat, family = gaussian, REML = TRUE, verbose = FALSE)
summary(kaz1)

SAS:

proc glimmix data=sample ;
where flag_SAT=1 ;
class group_school ;
model SAT_TOTAL=treat pretest_GPA male minority disadv/
solution ddfm=kr dist=normal link=identity;
random intercept /subject=group_school;
run;

 

NON-LINEAR MODELING (I don't like the degree of freedom option, though. KR is not working. See the syntax at the bottom of this page for specifying DF)

SAS:

proc glimmix data=sample METHOD=LAPLACE ;
*where flag_CE=1 ;
where flag_SAT=1 ;
*where flag_DE=1 ;
class group_school ;
model enroll_fall=treat pretest_GPA male minority disadv /
solution /*ddfm=kr*/ dist=binomial link=logit ;
random intercept /subject=group_school;
run;

R:

m <- glmer(enroll_fall ~ treat + pretest_GPA + male + minority + disadv +
(1 | group_school), data = sas_data_Sat, family = binomial, control = glmerControl(optimizer = "bobyqa"),
nAGQ = 10)
#print(m, corr = FALSE)
summary(m)

 

One can specify DF this way.

proc glimmix data=whole METHOD=LAPLACE ;
by subgroup;
where flag_SAT=1 ;
class group_school ;
model &var1=treat C_pretest_GPA male minority disadv /
solution /*ddfm=kr*/ dist=binomial link=logit
ddf=36.157,.,.,.;
random intercept /subject=group_school;
ods output ParameterEstimates=_&var1;
run;

 

Leave a Reply