Announcement

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

  • panel data Poisson regression with clustered standard errors

    Hi, I'm trying to run a panel data Poisson regression with fixed effect (for both time and group) and clustered standard errors (for the group). I try to do some kind of diff-in-diff with count data if it matters. Right now I use the xtpoisson command with the options: fe vce(robust) . Do I get the right answer?

    this is the syntax I use:

    xtpoisson y x i.year,fe vce(robust)
    Last edited by muly san; 29 Oct 2017, 08:06.

  • #2
    Hi Muly,

    I think the following thread, which addresses xtreg rather than xtpoisson, applies to your situation:

    https://www.statalist.org/forums/for...re-appropriate

    You might also want to refer to the manual; see help xtpoisson, which provides useful summaries of the robust and vce() options.

    As I understand it, the option robust accounts for heteroscedasticity, while vce(robust) and vce(cluster panelVar) produce equivalent estimates that account for heteroscedasticity and within-cluster correlation.

    hth,

    Paul
    Last edited by Paul Spin; 29 Oct 2017, 08:25.

    Comment


    • #3
      Muly:
      as per -poisson- data entry in Stata .pdf manual, -xtpoissson, fe- does not allow for -cluster()- but for -robust- option only.
      But the resulting standard errors is a robust clustered one, so you actually got what you were looking for, as reported above the output table of your -xtpoisson- regresion, just like in the following example:
      Code:
      . use http://www.stata-press.com/data/r14/ships.dta
      
      . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, exp(service) irr fe vce(robust)
      
      Iteration 0:   log pseudolikelihood = -80.738973
      Iteration 1:   log pseudolikelihood = -54.857546
      Iteration 2:   log pseudolikelihood = -54.641897
      Iteration 3:   log pseudolikelihood = -54.641859
      Iteration 4:   log pseudolikelihood = -54.641859
      
      Conditional fixed-effects Poisson regression    Number of obs     =         34
      Group variable: ship                            Number of groups  =          5
      
                                                      Obs per group:
                                                                    min =          6
                                                                    avg =        6.8
                                                                    max =          7
      
                                                      Wald chi2(4)      =    2582.51
      Log pseudolikelihood  = -54.641859              Prob > chi2       =     0.0000
      
                                         (Std. Err. adjusted for clustering on ship)
      ------------------------------------------------------------------------------
                   |               Robust
          accident |        IRR   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
          op_75_79 |   1.468831   .1114026     5.07   0.000      1.26594     1.70424
          co_65_69 |   2.008002   .1253984    11.16   0.000     1.776672    2.269453
          co_70_74 |    2.26693   .2340937     7.93   0.000     1.851566    2.775474
          co_75_79 |   1.573695   .2495366     2.86   0.004     1.153315    2.147303
       ln(service) |          1  (exposure)
      ------------------------------------------------------------------------------
      PS: crossed in the cyberspace wit Paul's helpful reply.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Thank you very much, Paul and Carlo.

        May I ask one more question? (it's more about econometrics and less about stata)

        I have a small sample (16 groups). Which standard errors make more sense in this context, clustered (by group) or newey-west?

        Comment


        • #5
          Muly:
          how many time spells do you have?
          What's the reason for clustering?
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            I have 30 years, the outcome variable (number of patents per year-group) is serially correlated. I want to do diff-in-diff with continuous treatment if it matters. Thanks!

            Comment


            • #7
              Muly:
              with short N, large T panel dataset autocorrelation is, in all likelihood, an issue.
              The user-written programme (as everyone on this list is requested to specify when the command is not included among the official ones. The reason of this seemingly pedantic request is well explained in AFQ) -nwest- sound better (to me, at least).
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Thank you very much! Do you know about a reference the compare the small sample properties of those alternatives?

                Comment


                • #9
                  Muly:
                  the abstract of https://www.sciencedirect.com/scienc...0440769190076P seems promising (unfortunately, I have no access to the full article).
                  We would be best off if Jeff chime in directly to enlighten us on this interesting topic.
                  Last edited by Carlo Lazzaro; 29 Oct 2017, 11:53.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Thank you very much! I will take a look in it.

                    Right now I cannot calculate the Newey-West standard errors due to a syntax issue with -nwest- command.

                    I found a different option:

                    glm y x i.group i.year, family(poisson) vce(hac nwest 3 ) t(year)

                    but now I get the error message:

                    repeated time values in sample.

                    I think that it is the same problem that happens when you try to run -newey- on panel data. But in this case, I cannot solve the problem using the force option.

                    Thanks again for your time
                    Last edited by muly san; 29 Oct 2017, 12:12.

                    Comment

                    Working...
                    X