Announcement

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

  • Fixed effects and survey weights

    Hi all,

    I am working with a panel dataset where the panel variable is woman and the time variable is year. I would like to run a regression with both province and year fixed effects (but not woman FE!). I am clustering standard errors at the province level, accordingly:

    xtreg birth_male i.gender age i.province i.year if no_child==0, vce(cluster province)

    birth_male is a binary variable while gender, the regressor of interest has four categories.

    Now, given that I would like to run this regression with survey weights which are not supported by xtreg, I tried to run the command below. My aim was to check whether the outputs of the two regressions are identical, as expected.

    reg birth_male i.gender age i.province i.year if no_child==0, vce(cluster province)

    surprisingly, this is not the case and I am not getting why. Probably the issue is that the second command ignores the panel structure of the data. How can I solve this problem?

    Any clue?

    Many thanks!

  • #2
    EDITED:

    but not woman FE!
    If you imply that all individuals in the sample are women, then the first regression controls for individual effects. Better to use this terminology than "woman FE" which can be confusing.


    birth_male is a binary variable while gender, the regressor of interest has four categories.
    This is confusing as well. Gender is considered to be binary; male and female. So how do you have 4 categories? In any case, gender is usually considered to be time invariant, so it will drop out of the estimation.


    I would like to run a regression with both province and year fixed effects (but not woman FE!)
    Probably the comparison that you want is:

    Code:
    xtset province
    xtreg birth_male i.gender age i.year if no_child==0, vce(cluster province)
    reg birth_male i.gender age i.province i.year if no_child==0, vce(cluster province)
    Since your outcome is binary, a more appropriate estimator is xtlogit which can estimate a conditional FE logit model, unless you want to estimate a linear probability model. See

    Code:
    help xtlogit
    Last edited by Andrew Musau; 29 Jan 2024, 10:05.

    Comment


    • #3
      Giulia:
      as an aside to Andrew0s excellent reply, please note:
      1) if women do not change -province- during the timespan your panel stretches over, the -fe- estimator will wipe this predictor out;
      2) there's no way that -xtreg,fe- and -regress- can give you back the same sample estimates (exception made for the constant; see Constant in a Fixed Effects Model - Statalist) if you do not add -i.panelvar- in the righ-hand side of your -regress-equation, as in the following toy-example:
      Code:
      . xtreg ln_wage c.age##c.age if idcode<=40, fe vce(cluster idcode)
      
      Fixed-effects (within) regression               Number of obs     =        276
      Group variable: idcode                          Number of groups  =         34
      
      R-squared:                                      Obs per group:
           Within  = 0.0860                                         min =          1
           Between = 0.2647                                         avg =        8.1
           Overall = 0.1424                                         max =         15
      
                                                      F(2, 33)          =       2.56
      corr(u_i, Xb) = 0.2088                          Prob > F          =     0.0923
      
                                      (Std. err. adjusted for 34 clusters in idcode)
      ------------------------------------------------------------------------------
                   |               Robust
           ln_wage | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               age |   .0471642   .0489821     0.96   0.343    -.0524907    .1468191
                   |
       c.age#c.age |  -.0005725   .0007691    -0.74   0.462    -.0021372    .0009922
                   |
             _cons |    1.05726   .7447384     1.42   0.165    -.4579212    2.572442
      -------------+----------------------------------------------------------------
           sigma_u |  .33403602
           sigma_e |  .26421062
               rho |  .61514812   (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      
      . reg ln_wage c.age##c.age i.idcode if idcode<=40, vce(cluster idcode)
      
      Linear regression                               Number of obs     =        276
                                                      F(1, 33)          =          .
                                                      Prob > F          =          .
                                                      R-squared         =     0.5969
                                                      Root MSE          =     .26421
      
                                      (Std. err. adjusted for 34 clusters in idcode)
      ------------------------------------------------------------------------------
                   |               Robust
           ln_wage | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               age |   .0471642   .0522412     0.90   0.373    -.0591214    .1534498
                   |
       c.age#c.age |  -.0005725   .0008203    -0.70   0.490    -.0022414    .0010963
                   |
            idcode |
                2  |  -.3720612   .0137092   -27.14   0.000    -.3999529   -.3441696
                3  |  -.5229158   .0333729   -15.67   0.000    -.5908135   -.4550182
                4  |  -.1295612   .0399275    -3.24   0.003    -.2107943   -.0483281
                5  |  -.2307167   .0298778    -7.72   0.000    -.2915037   -.1699298
                6  |  -.3054527   .0277416   -11.01   0.000    -.3618933    -.249012
                7  |  -.6488146   .0236138   -27.48   0.000    -.6968572    -.600772
                9  |   .0172563   .0043347     3.98   0.000     .0084372    .0260754
               10  |  -.6596642   .0304618   -21.66   0.000    -.7216392   -.5976893
               12  |   .7359191   .0717112    10.26   0.000     .5900216    .8818166
               13  |   .1302922   .0365034     3.57   0.001     .0560253     .204559
               14  |  -.0918187   .0717112    -1.28   0.209    -.2377162    .0540788
               15  |   .3402376   .0562453     6.05   0.000     .2258058    .4546694
               16  |   .0495111   .0279818     1.77   0.086    -.0074183    .1064405
               17  |   .1451495   .0020694    70.14   0.000     .1409393    .1493596
               18  |  -.6431574   .0561833   -11.45   0.000    -.7574631   -.5288516
               19  |  -.1083449   .0270679    -4.00   0.000    -.1634151   -.0532748
               20  |  -.0045038   .0284922    -0.16   0.875    -.0624716    .0534641
               21  |  -.1997627   .0062445   -31.99   0.000    -.2124673    -.187058
               22  |   .0615259   .0247813     2.48   0.018      .011108    .1119438
               23  |  -.2576115   .0539656    -4.77   0.000    -.3674053   -.1478176
               24  |  -.0641354   .0281672    -2.28   0.029    -.1214419   -.0068288
               25  |   .0198243   .0349148     0.57   0.574    -.0512104    .0908591
               26  |   -.199603   .0191288   -10.43   0.000    -.2385208   -.1606853
               27  |   .0591226   .0154214     3.83   0.001     .0277475    .0904976
               29  |  -.1046513   .0405522    -2.58   0.014    -.1871553   -.0221473
               30  |  -.5672304   .0130348   -43.52   0.000    -.5937498   -.5407109
               33  |  -.4128276    .032045   -12.88   0.000    -.4780236   -.3476316
               35  |  -.9723965   .0512393   -18.98   0.000    -1.076644   -.8681493
               36  |  -.1954419   .0288021    -6.79   0.000    -.2540401   -.1368437
               37  |    -.60211   .0611493    -9.85   0.000    -.7265192   -.4777007
               38  |  -.4755675   .0274881   -17.30   0.000    -.5314925   -.4196425
               39  |   .1111017   .0823492     1.35   0.186     -.056439    .2786424
               40  |  -.1794198   .0663681    -2.70   0.011    -.3144467   -.0443929
                   |
             _cons |    1.21754   .7810231     1.56   0.129    -.3714631    2.806544
      ------------------------------------------------------------------------------
      .
      Kind regards,
      Carlo
      (StataNow 18.5)

      Comment

      Working...
      X