[R] Comparing Negative Binomial Regression in Stata and R. Constants differ?

Thomas Lumley tlumley at u.washington.edu
Thu Dec 4 17:43:49 CET 2003


On Thu, 4 Dec 2003, Peter Dalgaard wrote:

> Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:
>
> > > report.  In the Stata output, they report alpha, same as 1/theta from
> > > the R glm.nb output.  Except for minor differences in standard errors,
> > > only the intercept estimates markedly differ.
> >
> > What are the variable codings used?  Intercepts depend on coding of
> > factors, and that applies to any sort of regression.
>
> ..and the fact that the difference between the two intercepts equals
> the gender effect quite strongly suggests that Stata has gender coded
> 1 for females and 2 for males.
>

and this turns out to be the case.

In stata after fitting the model

lincom _cons+gender
 ( 1)  [daysabs]gender + [daysabs]_cons = 0

------------------------------------------------------------------------------
     daysabs |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   2.716069    .232576    11.68   0.000     2.260229     3.17191
------------------------------------------------------------------------------

which agrees almost exactly with the R intercept.


	-thomas




More information about the R-help mailing list