BookmarkSubscribeRSS Feed
Siz
Fluorite | Level 6 Siz
Fluorite | Level 6

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?

3 REPLIES 3
Ksharp
Super User

Try Generalize Linear Mixed Model.

Check PROC GLIMMIX .

RyanSimmons
Pyrite | Level 9

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.

Siz
Fluorite | Level 6 Siz
Fluorite | Level 6

Thank you so much. This has been very helpful!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is ANOVA?

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.

Discussion stats
  • 3 replies
  • 9312 views
  • 4 likes
  • 3 in conversation