Announcement

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

  • #16
    Jannis:
    1) the investgated -fe- is the one of the -panelid-;
    2) -i.year- is a categorical predictor that account for within panel time-related variations. In the literature you can read taht this model is called two-way fixed effect, even though you cannit routunely retrieve the fixed efefct of time (wherea the community-contributed module -reghdfe- allows it);
    3) more substantively, as you can see from the folowing toy-example, omitting -i.year- from the set of predictors reduces the within R-sq of the model (nad the same holds for -reghdfe-, too):
    Code:
    . use "https://www.stata-press.com/data/r17/nlswork.dta"
    (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
    
    . xtset idcode year
    
    Panel variable: idcode (unbalanced)
     Time variable: year, 68 to 88, but with gaps
             Delta: 1 unit
    
    . xtreg ln_wage i.year c.age##c.age, fe vce(cluster idcode)
    
    Fixed-effects (within) regression               Number of obs     =     28,510
    Group variable: idcode                          Number of groups  =      4,710
    
    R-squared:                                      Obs per group:
         Within  = 0.1162                                         min =          1
         Between = 0.1078                                         avg =        6.1
         Overall = 0.0932                                         max =         15
    
                                                    F(16,4709)        =      79.11
    corr(u_i, Xb) = 0.0613                          Prob > F          =     0.0000
    
                                 (Std. err. adjusted for 4,710 clusters in idcode)
    ------------------------------------------------------------------------------
                 |               Robust
         ln_wage | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
            year |
             69  |   .0647054   .0155249     4.17   0.000     .0342693    .0951415
             70  |   .0284423   .0264639     1.07   0.283    -.0234395     .080324
             71  |   .0579959   .0384111     1.51   0.131    -.0173078    .1332996
             72  |   .0510671   .0502675     1.02   0.310    -.0474808     .149615
             73  |   .0424104   .0624924     0.68   0.497    -.0801038    .1649247
             75  |   .0151376    .086228     0.18   0.861    -.1539096    .1841848
             77  |   .0340933   .1106841     0.31   0.758    -.1828994     .251086
             78  |   .0537334   .1232232     0.44   0.663    -.1878417    .2953084
             80  |   .0369475   .1473725     0.25   0.802    -.2519716    .3258667
             82  |   .0391687   .1715621     0.23   0.819    -.2971733    .3755108
             83  |    .058766   .1836086     0.32   0.749    -.3011928    .4187249
             85  |   .1042758   .2080199     0.50   0.616    -.3035406    .5120922
             87  |   .1242272   .2327328     0.53   0.594    -.3320379    .5804922
             88  |   .1904977   .2486083     0.77   0.444    -.2968909    .6778863
                 |
             age |   .0728746    .013687     5.32   0.000     .0460416    .0997075
                 |
     c.age#c.age |  -.0010113   .0001076    -9.40   0.000    -.0012224   -.0008003
                 |
           _cons |   .3937532   .2469015     1.59   0.111    -.0902893    .8777957
    -------------+----------------------------------------------------------------
         sigma_u |  .40275174
         sigma_e |  .30127563
             rho |  .64120306   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    . xtreg ln_wage  c.age##c.age, fe vce(cluster idcode)
    
    Fixed-effects (within) regression               Number of obs     =     28,510
    Group variable: idcode                          Number of groups  =      4,710
    
    R-squared:                                      Obs per group:
         Within  = 0.1087                                         min =          1
         Between = 0.1006                                         avg =        6.1
         Overall = 0.0865                                         max =         15
    
                                                    F(2,4709)         =     507.42
    corr(u_i, Xb) = 0.0440                          Prob > F          =     0.0000
    
                                 (Std. err. adjusted for 4,710 clusters in idcode)
    ------------------------------------------------------------------------------
                 |               Robust
         ln_wage | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             age |   .0539076    .004307    12.52   0.000     .0454638    .0623515
                 |
     c.age#c.age |  -.0005973    .000072    -8.30   0.000    -.0007384   -.0004562
                 |
           _cons |    .639913   .0624195    10.25   0.000     .5175415    .7622845
    -------------+----------------------------------------------------------------
         sigma_u |   .4039153
         sigma_e |  .30245467
             rho |  .64073314   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    .
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #17
      So this code would be the right code if i use -reghdfe- and only consider idcode fixed effects ?

      Code:
      reghdfe ln_wage c.age##c.age,absorb(idcode) vce(cluster idcode)

      Comment


      • #18
        Jannis:
        yes, but your model may be misspecified.
        See, if interested, https://www.statalist.org/forums/for...ata-regression
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment

        Working...
        X