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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3180 views
  • 0 likes
  • 2 in conversation