Home  /  Resources & support  /  FAQs  /  xtgee and SAS standard errors

Why do Stata’s xtgee standard errors differ from those reported by SAS’s PROC GENMOD?

Title   Interpreting standard errors produced by Stata’s xtgee and SAS’s proc GENMOD
Author 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:

  1. SAS default
    Can be duplicated in Stata if you use the vce(robust) option. The standard errors will differ by a scale factor that is equal to sqrt(C/(C − 1)), which Stata applies to the variance matrix.
  2. SAS MODELSE option specified
    Can be obtained in Stata by default. The standard errors will differ by a scale factor that is equal to the sqrt(phi coefficient * n/(n − k)).
  3. SAS MODELSE and SCALE=1 options specified
    Can be obtained in Stata using the default options.

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.