|Interpreting standard errors produced by Stata’s xtgee and SAS’s proc GENMOD
|James Hardin, StataCorp
A user asked
I tried to run the same model using Stata’s xtgee and SAS’s PROC GENMOD. I get the same coefficient estimates and working correlation matrix but different standard errors. xtgee seems to be consistently lower. I’m using a Poisson distribution and exchangeable correlation.
The part of the SAS output titled “Analysis of initial estimates” is the output for a pooled Poisson estimator (which is almost identical to the GEE output since the extra correlation parameter is nearly zero).
What SAS calls “empirical standard errors” are (almost) equal to what Stata calls “robust standard errors”. They are not exactly equal because Stata multiplies clustered robust variance matrices by a factor equal to C/(C − 1), where C is the number of clusters. Run the xtpoisson/xtgee with the vce(robust) option and you will see this relationship.
SAS also has an option to the REPEATED statement called MODELSE where you will get “model standard errors” instead of “empirical standard errors”. If you use that option you will get Pearson chi2 scaled standard errors, which are different from what Stata prints out (without the vce(robust) option). To get the same answers as provided by Stata in its default case, you should also specify the SCALE=1 option on the REPEATED statement in SAS. This applies if the family you specify is discrete (Poisson or binomial).
Here are the relationships for SAS models again:
There is one difference between SAS 6.12 TS Level 0060 (and Windows version 4.10.1650) and Stata that cannot be explained: The results (beta, working correlation matrix, and standard errors) of using PROC GENMOD do not match xtgee when panels are unbalanced.
Classroom and web training
Teaching with Stata
Statalist: The Stata Forum
Last updated: 16 November 2022
StataCorp LLC (StataCorp) strives to provide our users with exceptional products and services. To do so, we must collect personal information from you. This information is necessary to conduct business with our existing and potential customers. We collect and use this information only where we may legally do so. This policy explains what personal information we collect, how we use it, and what rights you have to that information.
These cookies are essential for our website to function and do not store any personally identifiable information. These cookies cannot be disabled.
Please note: Clearing your browser cookies at any time will undo preferences saved here. The option selected here will apply only to the device you are currently using.