Announcement

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

  • margins xb versus nu0 after xtnbreg

    I'm having trouble figuring out difference between the predict(nu0) and predict(xb) options in a margins statement following the execution of an xtnbreg statement.

    The outcome is the number of events, so I'm not sure why the predict(nu0) is giving me such a higher number than the data suggests it should be. The results using the predict(xb) option are much more in line with the data. I must be missing something obvious.

    Here is my code.
    Code:
    xtnbreg _freq weeks_pre interven weeks_post i.month incidents percent_black percent_hispanic percent_renters percent_poverty temperature, fe exposure(total_pop)
    margins, predict(xb) atmeans at(weeks_pre=(159(1)161) weeks_post = 0 interven= 0 ) noatlegend
    margins, predict(nu0) atmeans at(weeks_pre=(159(1)161) weeks_post = 0 interven= 0 ) noatlegend
    Results of first margins statement:
    Adjusted predictions Number of obs = 2,275
    Model VCE : OIM

    Expression : Linear prediction, predict()


    Delta-method
    Margin Std. Err. z P>z [95% Conf. Interval]

    _at
    1 4.255655 .2001827 21.26 0.000 3.863304 4.648006
    2 4.256663 .2000239 21.28 0.000 3.864623 4.648703
    3 4.257671 .1998727 21.30 0.000 3.865928 4.649415

    Results of second margins statement:
    Adjusted predictions Number of obs = 2,275
    Model VCE : OIM

    Expression : Predicted number of events (assuming u_i=0), predict(nu0)


    Delta-method
    Margin Std. Err. z P>z [95% Conf. Interval]

    _at
    1 89.33351 17.88302 5.00 0.000 54.28343 124.3836
    2 89.42362 17.88686 5.00 0.000 54.36602 124.4812
    3 89.51383 17.89137 5.00 0.000 54.44739 124.5803


    Summary of the outcome variable:
    Mean SD Min. Max.
    Outcome 10.98 10.41 0 77

  • #2
    why the predict(nu0) is giving me such a higher number than the data suggests it should be
    - because you using an exposure variable exposure(total_pop)

    Comment


    • #3
      Usual health warning: the NB model is not a real fixed effects model so be careful.

      Joao

      Comment


      • #4
        Joao, what do you mean by that?

        Comment


        • #5
          Thanks for your responses - I get essentially the same results whether there is an exposure variable in the model or not. I'm not sure what the difference between the xb and nu0 options are in this example.

          Comment


          • #6
            Dear Alison Levin-Rector,

            Please see

            Guimaraes, P. (2008). "The fixed effects negative binomial model revisited," Economics Letters, 99 (1), 63-66

            The first sentence of the abstract is very informative:

            In this paper I show that the conditional fixed effects negative binomial model for count panel data does not control for individual fixed effects unless a very specific set of assumptions are met.

            My suggestion is that you simply use Poisson regression with fixed effects because it is much more robust.

            Best wishes,

            Joao
            Last edited by Joao Santos Silva; 08 Jul 2020, 10:49.

            Comment


            • #7
              t. I'm not sure what the difference between the xb and nu0 options are in this example.
              In a simplified setting:

              E[Y] = mu = exp(XB)

              The difference between the fitted values (xb) and the expected count (nu0) is exponentiation. I am not sure you would want to directly display the fitted values.

              Comment

              Working...
              X