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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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