[R] About calculation of the gravity model in R and STATA software

peter dalgaard pdalgd at gmail.com
Wed Mar 16 14:41:27 CET 2016

On 16 Mar 2016, at 14:10 , S Ellison <S.Ellison at LGCGroup.com> wrote:

>> As you can see, model coefficients (second column in the results table) are the
>> same at least until the 4th mark (!) However, other results (columns in the
>> table of results, since the third) is not the same.
>> Could you explain differences in the results?
> R and stata are clearly doing different things.
> Look up how stata calculates its standard errors (which I note are described as '_robust_ ') and compare that with the documentation for the R function.
> Without knowing anything about stata or your data set, my guess would be that R's quasibinomial family is allowing for overdispersion and stata is not.
> S Ellison

With a dispersion parameter of 2100, that would be rather more of a dramatic difference....

More likely, STATA is using some sort of sandwich estimator whereas R is just upscaling the results for a Poisson regression. You might want to check out package "sandwich".


Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com

More information about the R-help mailing list