BookmarkSubscribeRSS Feed
jdserbon
Calcite | Level 5

I have the following pseduo-code in which I need to calculate robust sandwich standard error estimates.  I do not believe you can perform this using PROC LOGISTIC, correct?  If not, which PROC would you recommend?  Which options to specify to substitute for the strata statement?  Thanks!

proc logistic data = data;

  class x5 /param = ref ref = first;

  model y (event = '1')=  x1 x2 x3 x4 x5 x6;

  strata x7;

  where (x9 = 1 or x10 = 1) & x5 ne '' & x7 ne '' & y_denom = 1 &

  x8 in ('name1','name2','name3','name4','name5');

  by x8;

run;

1 REPLY 1
SteveDenham
Jade | Level 19

Try this:

proc glimmix data=data empirical=classical; /* For a classical sandwich estimation */

class x5(param=ref ref=first) x7;

model y(event='1')=x1 x2 x3 x4 x5 x6/dist=binomial solution;

random intercept/subject=x7; /* To mimic the strata */

where (x9 = 1 or x10 = 1) & x5 ne '' & x7 ne '' & y_denom = 1 & 

  x8 in ('name1','name2','name3','name4','name5');

  by x8;

run;

The code is untested, so there will probably be some bugs along the way, but GLIMMIX is the only way I can think of to get sandwich estimators for generalized linear models.

Steve Denham

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
  • 1 reply
  • 3746 views
  • 0 likes
  • 2 in conversation