BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mike19
Fluorite | Level 6

Hi there,

 

I've been asked to calculate white standard errors for a logistic regression model for a work project. Here are some specifics about the data set I'm using:

1.  RCT data collected across 2 separate healthcare sites 

2. One observation per row (eg subjectid, age, race, cci, etc)

3. This is not survey data 

4. Need to cluster by the site variable 

 

The original model was created by the head statistician using Stata. I need to replicate his model using SAS. The survey logistic procedure produces p-values that are relatively close to those of the head statistician's model (magnitude of the ORs don't change). Have also tried using GENMOD and GLM but am unable to execute the procedures due to multiple error messages. 

 

Considering this, I would like to find the SAS implementation that most closely resembles Stata output for fitting a Logistic Regression model with Heteroskedastic Corrected Standard Errors (Huber White).

 

My Logistic Regression code: 

 

proc logistic data=x;
class gender (ref='1') race1 (ref='2') medicare (ref='0') medicaid (ref='0') priv_ins (ref='0') inc_ind (ref='1')
 hospitalizations2 (ref='0') diabetes(ref='0') cpd(ref='0') chf (ref='0') site (ref='1')
health_new (ref='1') receive_care (ref='1')/param=ref;
model alert (event='1') = agebaseline gender race1 medicare medicaid priv_ins inc_ind traveltime 
hospitalizations2 edvisits update_cci cpd chf diabetes pt_days site health_new receive_care;
run;

 

Any help would be greatly appreciated!

 

Kind regards,

M

1 ACCEPTED SOLUTION

Accepted Solutions
8 REPLIES 8
Mike19
Fluorite | Level 6

Hi there,

I've been asked to calculate white standard errors for a logistic regression model for a work project. Here are some specifics about the data set I'm using:
1. RCT data collected across 2 separate healthcare sites
2. One observation per row (eg subjectid, age, race, cci, etc)
3. This is not survey data
4. Need to cluster by the site variable

The original model was created by the head statistician using Stata. I need to replicate his model using SAS. The survey logistic procedure produces p-values that are relatively close to those of the head statistician's model (magnitude of the ORs don't change). Have also tried using GENMOD and GLM but am unable to execute the procedures due to multiple error messages.

Considering this, I would like to find the SAS implementation that most closely resembles Stata output for fitting a Logistic Regression model with Heteroskedastic Corrected Standard Errors (Huber White).

My Logistic Regression code:

proc logistic data=x;
class gender (ref='1') race1 (ref='2') medicare (ref='0') medicaid (ref='0') priv_ins (ref='0') inc_ind (ref='1')
hospitalizations2 (ref='0') diabetes(ref='0') cpd(ref='0') chf (ref='0') site (ref='1')
health_new (ref='1') receive_care (ref='1')/param=ref;
model alert (event='1') = agebaseline gender race1 medicare medicaid priv_ins inc_ind traveltime
hospitalizations2 edvisits update_cci cpd chf diabetes pt_days site health_new receive_care;
run;

Any help would be greatly appreciated!

Kind regards,
M

PaigeMiller
Diamond | Level 26

Perhaps this helps?

https://communities.sas.com/t5/SAS-Procedures/White-standard-errors/td-p/129061

 

Anyway, please don't post the same question twice.

--
Paige Miller
Mike19
Fluorite | Level 6
Thank you for your reply. Oops, apologies for the duplicate posts....

I read the above link earlier this week and it wasn’t very helpful. I’m asking the question bc I’ve exhausted all of my readily available information sources (SAS Help, UCLA site, and even YouTube).

Any help is welcome.
PaigeMiller
Diamond | Level 26

@Mike19 wrote:
Thank you for your reply. Oops, apologies for the duplicate posts....

I read the above link earlier this week and it wasn’t very helpful. I’m asking the question bc I’ve exhausted all of my readily available information sources (SAS Help, UCLA site, and even YouTube).

Any help is welcome.

Have you tried using an internet search engine?

--
Paige Miller
Ksharp
Super User

Better post it at Stat Forum and calling @StatDave 

StatDave
SAS Super FREQ

See the Generalized linear models part of the item "White's empirical ("sandwich") variance estimator and robust standard errors" in the Frequently-Asked for Statistics (FASTats list) which is a link in the Important Links section on the right side of the Statistical Procedures Community page.

Mike19
Fluorite | Level 6
This is very helpful, thanks.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 4759 views
  • 1 like
  • 4 in conversation