I am using proc logistic to investigate the association between the variables laek and pv (indexar, alder, arv, and koen are confounders). The model looks something like this:
proc logistic data=dataset;
class indexar (ref='2010') koen (ref='K') / param = ref ;
model laek(EVENT='1') = pv indexar alder arv koen;
run;
The individual level dataset that I am using is obtained from patients who are grouped within different clinics. I believe that the clinic effect is a mediator rather than a confunder. How can I adjust for clustering? Should I use a "sandwich" estimator and in that case, how do I do that in SAS?
Try Generalize Linear Mixed Model.
Check PROC GLIMMIX .
Depending on the exact type of inference you are interested in, you can account for such clustering in a number of ways. The two simplest ways are probably in GENMOD or GLIMMIX (though, depending on the details of the analysis you can also use PROC SURVEYLOGISTIC or even PROC PHREG, or reparameterize your data to use a conditional maximum likelihood approach in PROC LOGISTIC. But these are less intuitive and more complicated approaches, I think).
For example, you can fit a generalized estimating equation (GEE):
PROC GENMOD data=dataset;
class indexar (ref='2010') koen (ref='K') / param = ref ;
model laek(EVENT='1') = pv indexar alder arv koen;
repeated subject=patient_id/ type=un;
run;
You can fit just fit a normal logistic model but with the empirical ("sandwich") variance estimators:
PROC GLIMMIX data=dataset empirical;
class indexvar koen;
model laek(event='1') = pv indexar alder arv koen;
run;
You can fit a mixed effects model:
PROC GLIMMIX data=dataset;
class indexvar koen;
model laek(event='1') = pv indexar alder arv koen;
random intercept / subject=patient_id;
run;
For both the RANDOM statement in GLIMMIX and the REPEATED statement in GENMOD, you can also specify a hierarchical (nested) structure (e.g. "random intercept / subject=patient_id(clinic_id)" for patients nested within clinics), though I would consult this note (http://support.sas.com/kb/24/200.html) and/or this document (https://support.sas.com/resources/papers/proceedings14/SAS026-2014.pdf) to make sure you understand exactly what it is you are specifying and how to interpret it.
Thank you so much. This has been very helpful!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.