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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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