I am trying to reproduce a GLM in SAS that I originally created in Stata. Although my estimates are exactly the same, the standard errors are not, and I'm not quite sure why. Note that cost is continuous while treatment, var1, and var2 are all categorical. Here is both codes:
SAS
proc genmod data=data; class clinician treatment var1 var2 / param=ref; model cost = treatment var1 var2/ link=LOG dist=gamma type3; repeated SUBJECT=clinician/ PRINTMLE TYPE=ind; run;
Stata
glm cost i.treatment i.var1 i.var2, f(gam) l(log) cluster(clinician)
testparm i.treatment
Appreciate the help
Figured it out. The answer is twofold.
1) Genmod and Stata estimate the scale parameter and correlation structure slightly differently. Details are given on xtgee-related FAQ.
2) Genmod by default produces score type III tests while Stata produces Wald type III tests. Wald tests can be requested for SAS, but score tests cannot be produced by Stata.
Are the degrees of freedom the same? Show us.
Yes, DFs are all the same along with the estimates. Only the standard errors (and thus the p-values) are different)
How far apart are these estimates of standard errors? Give us a specific case, what are the actual numbers from SAS and what is the actual number in STATA?
What is the estimate of Scale from each program?
The estimate for treatment is -0.0356. In SAS, the standard error is 0.1301 while in Stata, the standard error is 0.1469.
I'm not sure how to find the scale in Stata, but the scale is SAS is 0.5432.
I don't understand, it seems as if you have not answered my question, or you did answer my question but worded it confusingly.
The standard error for treatment in SAS is _________________
The standard error for treatment in STATA is _________________
My apologies. My last reply had a few errors. It is rewritten, but to again answer your question:
The standard error for treatment in SAS is 0.1301.
The standard error for treatment in STATA is 0.1469.
Ok, so at this point, I have to say I don't really have enough familiarity with STATA to help further, but the problem (in my opinion) is either
Figured it out. The answer is twofold.
1) Genmod and Stata estimate the scale parameter and correlation structure slightly differently. Details are given on xtgee-related FAQ.
2) Genmod by default produces score type III tests while Stata produces Wald type III tests. Wald tests can be requested for SAS, but score tests cannot be produced by Stata.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.