I am trying to run a mixed effect logistic model using proc glimmix with two random intercepts. Some background on the data, doctors and clinics were randomized to receive an intervention, so both doctors, clinics and patients have multiple visits. The goal is to determine whether doctors prescribing decreases over time, rather than patient level effects. This original model execution by a different analyst in R derived two random intercepts for doctor and clinic, but I can’t find a straightforward way to do this in SAS. I am having trouble distinguishing between ‘random’, ‘repeat’ and ‘subject’ in proc glimmix. I’ve tried a few things, but the only model that worked was: proc glimmix data=mydata method=quad;
class doctor clinic intervention (ref=‘0’) control (ref=‘0’);
model prescription (event =‘1’)=intervention time control intervention*time control*time intervention*control/solution link=logit dist=binary;
random intercept/subject=doctor(clinic) type=un;
run; This gives me only one intercept for doctor(clinic), whereas the same model in R provides a random intercept for both doctor and clinic. The coefficients are also different. Both model variables have the exact same counts and structure. Below is the code in R: Model <- glmer(prescription ~ intervention + time + control + intervention:time + control:time + intervention:control + (1|doctor) + (1|provid), data=mydata, family=binomial(link=logit), nAGQ=1, control=glmerControl(calc.derivs=FALSE)) Is there a way to get the random intercepts for both doctor and clinic in SAS? Is there a reason why the results between SAS and R are inconsistent? I also tried the code below, but received an error that ‘Estimation by quadrature is available only if the data can be processed by subjects’: proc glimmix data=mydata method=quad;
class doctor clinic intervention (ref=‘0’) control (ref=‘0’);
model prescription (event =‘1’)=intervention time control intervention*time control*time intervention*control/solution link=logit dist=binary;
random intercept/subject=doctor type=un;
random intercept/subject=clinic type=un;
run;
... View more