Announcement

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

  • Poission regression using fixed effect while clustering

    Hello,

    My dependent variable is number of incidents in a region over different years. My region is unit and I'm trying to cluster also at unit.

    To run xtpoission regression , is the following command correct where I wanted to include fixed effects of unit and year while clustering at unit?

    Code:
    xi: xtpoisson yvar xvar controlvar policy i.year i.unit, robust i(unit) fe
    Here the policy variable either takes the value 0 or 1. I'm trying to see how the policy affects the dependent variable y.
    Last edited by Tariq Abdullah; 09 Apr 2024, 11:14.

  • #2
    You can omit i.unit from the main portion of the xtpoisson statement. The i(unit) option takes care of that for you. Also, unless you are using a much older version of Stata, you do not need the xi: prefix. As of Stata 11, the program natively handles indicator variables correctly as long as they have i. in front of them.

    Comment


    • #3
      But, when I use the following command I do not see the unit fixed effect part in my regression at unit level on the log result.

      Code:
      xtpoisson yvar xvar controlvar policy i.year, robust i(unit) fe
      when I use ols regression the regression takes at least 30 min to perform since it's clustering at 4436 units. Also on the log result i can see getting the fixed effects of 6000 units.

      But the xtpoission result comes within two seconds without any evidence of fixed effects of those 4436 units. I just see the year fixed effects. However this part is mentioned (Std. err. adjusted for clustering on unit)

      This is OLS results log

      Code:
      
      Linear regression                               Number of obs     =     25,926
                                                      F(19, 4435)       =          .
                                                      Prob > F          =          .
                                                      R-squared         =     0.8636
                                                      Root MSE          =     10.428
      
                                         (Std. err. adjusted for 4,436 clusters in unit)
      This is my xtpoission regression's log

      Code:
      note: 80 groups (80 obs) dropped because of only one obs per group
      note: 2435 groups (13772 obs) dropped because of all zero outcomes
      
      Iteration 0:   log pseudolikelihood = -38287.836  
      Iteration 1:   log pseudolikelihood = -37988.815  
      Iteration 2:   log pseudolikelihood = -37988.714  
      Iteration 3:   log pseudolikelihood = -37988.714  
      
      Conditional fixed-effects Poisson regression         Number of obs    = 12,074
      Group variable: unit                              Number of groups =  1,921
      
                                                           Obs per group:
                                                                        min =      2
                                                                        avg =    6.3
                                                                        max =      7
      
                                                           Wald chi2(20)    =  38.22
      Log pseudolikelihood = -37988.714                    Prob > chi2      = 0.0083
      
                                             (Std. err. adjusted for clustering on unit)
      Last edited by Tariq Abdullah; 09 Apr 2024, 14:18.

      Comment

      Working...
      X