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
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
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.
Duplicate question
All replies should be at https://communities.sas.com/t5/SAS-Programming/Need-to-write-code-to-for-white-standard-error-for-lo...
@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?
Better post it at Stat Forum and calling @StatDave
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.
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!
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.
Ready to level-up your skills? Choose your own adventure.