Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Difference between glm, family(nbinomial 1) link(log) and nbreg ?

    Hi experts,

    I want to use negative binomial regression and was wondering what's the difference between "glm, family(nbinomial 1) link(log)" and "nbreg" ? Thank you!

  • #2
    In the PDF manuals that come with your Stata installation, in the -glm- chapter of the [R] volume, you could have found this:
    Some family() and link() combinations result in models already fit by Stata. These are
    family() link() Options Equivalent Stata command
    gaussian identity nothing j irls j irls vce(oim) regress
    gaussian identity t(var) vce(hac nwest #) newey, t(var) lag(#) (see note 1)
    vfactor(#v)
    binomial cloglog nothing j irls vce(oim) cloglog (see note 2)
    binomial probit nothing j irls vce(oim) probit (see note 2)
    binomial logit nothing j irls j irls vce(oim) logit or logistic (see note 3)
    poisson log nothing j irls j irls vce(oim) poisson (see note 3)
    nbinomial log nothing j irls vce(oim) nbreg (see note 4)
    gamma log scale(1) streg, dist(exp) nohr (see note 5)
    and
    4. Family negative binomial, log-link models—also known as negative binomial regression
    models—are used for data with an overdispersed Poisson distribution. Although glm can be
    used to fit such models, using Stata’s maximum likelihood nbreg command is probably better. In
    the GLM approach, you specify family(nbinomial #k) and then search for a #k that results in
    the deviance-based dispersion being 1. You can also specify family(nbinomial ml) to estimate
    #k via maximum likelihood, which will report the same value returned from nbreg. However,
    nbreg also reports a confidence interval for it; see [R] nbreg and Rogers (1993). Of course, glm
    allows links other than log, and for those links, including the canonical nbinomial link, you will
    need to use glm.
    which completely answers your question.

    Sorry, I can't seem to get the table from the manual to align nicely in the Forum editor. Neither quote blocks nor code blocks achieves that.

    Comment


    • #3
      Originally posted by Dan Su View Post
      Hi experts,

      I want to use negative binomial regression and was wondering what's the difference between "glm, family(nbinomial 1) link(log)" and "nbreg" ? Thank you!
      Hi Clyde, thanks so much! It seems nbreg is more recommended than glm, but when I use the nbreg, there are too many iterations and stata keep running, but glm is fine without causing any errors. And I found I got same coef by using both but different CI.

      Comment

      Working...
      X