Announcement

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

  • xtreg vs. reg: different result

    I ran a model with fixed effects using the following two methods, and I expect the coefficient estimate for "treated" to be the same/similar.

    But the results differ not insignificantly.

    Method 1:
    Code:
    xi: reg lwage treated i.state i.year $controls, cluster(state)
    Robust
    lwage Coef. Std. Err. t P>t [95% Conf. Interval]
    treated -.0545311 .012696 -4.30 0.000 -.0800446 -.0290176

    Method 2:
    Code:
    xtset state year
    xtreg lwage treated $controls, fe vce(cluster state)
    Robust
    lwage Coef. Std. Err. t P>t [95% Conf. Interval]
    treated -.0669304 .0148743 -4.50 0.000 -.0968214 -.0370394

    What is the reason for the difference? Or did I misspecify anything?


    Thanks!


  • #2
    The most likely explanation is that you didn't include year fixed effect in the second method. xtreg does not automatically include year fixed effects in the estimation.
    HTH
    Fernando

    Comment


    • #3
      These are two different models. The first one contains fixed effects for both state and year, but the second one contains only state effects.

      When you -xtset- your data and use an -xt- estimator, you automatically get fixed effects for the panel variable. But you do not get fixed effects for the time variable unless you name them explicitly as variables in the regression command.

      As an aside, the -xi- command is largely obsolete and you should more or less forget you ever knew it. It has been replaced by factor variable notation: see -help fvvarlist-. There are some Stata commands that still do not support factor variable notation and require the use of -xi-, but for the most part these are archaic commands that have, themselves, been largely replaced by modern commands that encompass the same calculations and do support factor variable notation. There are, admittedly, a handful of situations where -xi- is still useful and even the most modern commands do not allow factor-variable notation, but they are fairly exotic. So take up factor variable notation (which will allow you to make use of the wonderful -margins- command and will also simplify many regression model specifications) and tuck -xi- into a dusty back corner of your mind.

      Added: Crossed with #2 which highlights the same problem.

      Comment


      • #4
        FernandoRios Thank you! you're definitely right!


        Clyde Schechter Thank you as always! Just an old habit I picked up from my professors. Will definitely keep it in mind!

        Comment


        • #5
          Clyde Schechter May I follow up with this question? It now giving me very different results after I added a quadric stat-specific time trend:


          Method1
          Code:
          reg lwage treated i.state i.year $controls i.state##c.year##c.year, cluster(state)
          Robust
          lwage Coef. Std. Err. t P>t [95% Conf. Interval]
          treated .0261329 .0080116 3.26 0.002 .0100331 .0422328


          Method2
          Code:
          xtreg lwage treated i.year $controls i.state##c.year##c.year, fe vce(cluster state)
          Robust
          lwage Coef. Std. Err. t P>t [95% Conf. Interval]
          treated -.0382726 .0065913 -5.81 0.000 -.0515183 -.0250268

          Comment


          • #6
            I can't tell without seeing the complete output of both regressions.

            Comment


            • #7
              Clyde Schechter It appears that OLS dropped quadratic term but kept state FE and linear trend, but xtreg dropped state FE but kept both interaction terms. Why is the choice of omitting variable differ?

              Here is it. Sorry, the output is really long:

              Method 1:
              Code:
              Linear regression                               Number of obs     =      1,250
                                                              F(27, 49)         =          .
                                                              Prob > F          =          .
                                                              R-squared         =     0.9666
                                                              Root MSE          =     .02982
              
                                                      (Std. Err. adjusted for 50 clusters in state)
              -------------------------------------------------------------------------------------
                                  |               Robust
                            lwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              --------------------+----------------------------------------------------------------
                          treated |   .0261329   .0080116     3.26   0.002     .0100331    .0422328
                                  |
                            state |
                               2  |  -36.17335   2.212987   -16.35   0.000    -40.62052   -31.72619
                               3  |  -32.81572   1.312822   -25.00   0.000    -35.45393    -30.1775
                               4  |   .1126636   6.591338     0.02   0.986    -13.13313    13.35845
                               5  |  -24.25648   .4615767   -52.55   0.000    -25.18406   -23.32891
                               6  |  -19.95343   2.741324    -7.28   0.000    -25.46233   -14.44454
                               7  |  -44.12615   3.319284   -13.29   0.000    -50.79651    -37.4558
                               9  |  -25.69199   1.090259   -23.57   0.000    -27.88295   -23.50103
                              10  |    -17.411   3.056654    -5.70   0.000    -23.55357   -11.26842
                              11  |   -20.4717   3.008458    -6.80   0.000    -26.51742   -14.42597
                              12  |  -26.79742   1.243872   -21.54   0.000    -29.29707   -24.29776
                              13  |  -42.07455   3.861682   -10.90   0.000    -49.83489   -34.31421
                              14  |  -17.95453   2.543017    -7.06   0.000    -23.06492   -12.84415
                              15  |  -35.01909   2.906898   -12.05   0.000    -40.86072   -29.17746
                              16  |  -39.69767   2.388112   -16.62   0.000    -44.49676   -34.89858
                              17  |  -32.24021   2.443834   -13.19   0.000    -37.15128   -27.32914
                              18  |  -37.80227   2.490811   -15.18   0.000    -42.80774   -32.79679
                              19  |  -33.60808   4.367692    -7.69   0.000    -42.38529   -24.83087
                              20  |  -44.51344   3.127703   -14.23   0.000    -50.79879   -38.22808
                              21  |   -39.7398   .9004826   -44.13   0.000    -41.54939   -37.93021
                              22  |  -43.54108    2.90684   -14.98   0.000     -49.3826   -37.69957
                              23  |  -36.38179   3.046798   -11.94   0.000    -42.50457   -30.25902
                              24  |  -37.54612   1.405976   -26.70   0.000    -40.37154   -34.72071
                              25  |  -34.99252   2.158804   -16.21   0.000     -39.3308   -30.65424
                              26  |  -33.04157   2.477448   -13.34   0.000    -38.02019   -28.06295
                              27  |  -23.39811   2.250302   -10.40   0.000    -27.92026   -18.87596
                              28  |   -25.1828   1.497547   -16.82   0.000    -28.19224   -22.17337
                              29  |  -35.00125   5.458408    -6.41   0.000    -45.97033   -24.03217
                              30  |  -39.78949   2.791518   -14.25   0.000    -45.39926   -34.17972
                              31  |  -33.77585   1.194775   -28.27   0.000    -36.17684   -31.37486
                              32  |  -39.27935   2.500898   -15.71   0.000    -44.30509   -34.25361
                              33  |  -15.99187   .9770817   -16.37   0.000    -17.95539   -14.02835
                              34  |   19.67458   12.16311     1.62   0.112     -4.76811    44.11727
                              35  |  -39.72666   3.485097   -11.40   0.000    -46.73023    -32.7231
                              36  |  -35.13634   3.746491    -9.38   0.000     -42.6652   -27.60749
                              37  |  -20.28686   3.438414    -5.90   0.000    -27.19661   -13.37711
                              38  |  -21.17755   1.128087   -18.77   0.000    -23.44453   -18.91058
                              39  |  -40.34164   4.118247    -9.80   0.000    -48.61757   -32.06572
                              40  |  -43.41494   2.978145   -14.58   0.000    -49.39975   -37.43013
                              41  |  -29.95618   .6826219   -43.88   0.000    -31.32796    -28.5844
                              42  |  -39.80805   2.587202   -15.39   0.000    -45.00723   -34.60888
                              43  |  -37.92873   .8776665   -43.22   0.000    -39.69246   -36.16499
                              44  |  -12.80051   1.473255    -8.69   0.000    -15.76113   -9.839891
                              45  |  -12.21771   3.321052    -3.68   0.001    -18.89161   -5.543802
                              46  |   -37.1673   .7448545   -49.90   0.000    -38.66414   -35.67046
                              47  |  -36.91803   1.923683   -19.19   0.000    -40.78382   -33.05225
                              48  |  -22.22552   1.646785   -13.50   0.000    -25.53486   -18.91618
                              49  |    -37.464   2.101323   -17.83   0.000    -41.68677   -33.24124
                              50  |  -35.64333   5.573101    -6.40   0.000     -46.8429   -24.44376
                              51  |  -27.93493   4.038321    -6.92   0.000    -36.05024   -19.81962
                                  |
                             year |
                            1984  |  -.0275687   .0040007    -6.89   0.000    -.0356084   -.0195289
                            1985  |  -.0273947   .0052437    -5.22   0.000    -.0379323   -.0168572
                            1986  |    .000998   .0075081     0.13   0.895    -.0140901     .016086
                            1987  |  -.0062596   .0081249    -0.77   0.445    -.0225871    .0100679
                            1988  |  -.0345376   .0095563    -3.61   0.001    -.0537417   -.0153335
                            1989  |  -.1131549   .0092166   -12.28   0.000    -.1316763   -.0946334
                            1990  |  -.1327157   .0097714   -13.58   0.000     -.152352   -.1130794
                            1991  |  -.1618562   .0090928   -17.80   0.000    -.1801288   -.1435836
                            1992  |  -.1850898   .0098986   -18.70   0.000    -.2049818   -.1651979
                            1993  |  -.1932918   .0112056   -17.25   0.000    -.2158103   -.1707733
                            1994  |  -.3275327   .0106313   -30.81   0.000    -.3488971   -.3061683
                            1995  |  -.3391742   .0107399   -31.58   0.000    -.3607569   -.3175916
                            1996  |  -.2293491   .0109222   -21.00   0.000     -.251298   -.2074002
                            1997  |  -.2123682    .010313   -20.59   0.000    -.2330928   -.1916435
                            1998  |  -.1740775    .011341   -15.35   0.000     -.196868   -.1512869
                            1999  |  -.1771014   .0117066   -15.13   0.000    -.2006267   -.1535761
                            2000  |  -.3036969   .0117285   -25.89   0.000    -.3272661   -.2801276
                            2001  |  -.2821368   .0114236   -24.70   0.000    -.3050934   -.2591802
                            2002  |  -.2601558   .0121684   -21.38   0.000     -.284609   -.2357025
                            2003  |  -.2452815   .0129979   -18.87   0.000    -.2714018   -.2191611
                            2004  |  -.2893418   .0138559   -20.88   0.000    -.3171862   -.2614974
                            2005  |  -.4133361   .0126078   -32.78   0.000    -.4386724   -.3879997
                            2006  |  -.4268682   .0141236   -30.22   0.000    -.4552505   -.3984858
                            2007  |  -.4307693   .0145098   -29.69   0.000    -.4599279   -.4016106
                                  |
                          college |   .0047768   .0006991     6.83   0.000     .0033719    .0061817
                            metro |   .0000423   .0001489     0.28   0.777    -.0002568    .0003415
                             male |   .0014856   .0010942     1.36   0.181    -.0007133    .0036845
                            white |  -.0010569   .0009324    -1.13   0.262    -.0029306    .0008167
                             lpop |   .6443217   .1784324     3.61   0.001     .2857483    1.002895
                            lmile |          0  (omitted)
                       rtw_states |          0  (omitted)
                                  |
                     state#c.year |
                               1  |  -.0139132   .0020435    -6.81   0.000    -.0180197   -.0098068
                               2  |   .0034129   .0013688     2.49   0.016     .0006621    .0061636
                               3  |   .0018641   .0016217     1.15   0.256    -.0013949    .0051231
                               4  |  -.0147191   .0054156    -2.72   0.009    -.0256023    -.003836
                               5  |  -.0030787   .0024375    -1.26   0.213     -.007977    .0018195
                               6  |  -.0045827   .0034289    -1.34   0.188    -.0114733    .0023079
                               7  |   .0076437   .0008598     8.89   0.000     .0059159    .0093715
                               9  |  -.0011775   .0025637    -0.46   0.648    -.0063294    .0039745
                              10  |  -.0063584   .0037329    -1.70   0.095    -.0138599    .0011432
                              11  |  -.0045867   .0037263    -1.23   0.224     -.012075    .0029015
                              12  |  -.0008401   .0015213    -0.55   0.583    -.0038973    .0022171
                              13  |    .006505    .000629    10.34   0.000      .005241    .0077689
                              14  |  -.0052954   .0031735    -1.67   0.102    -.0116727     .001082
                              15  |   .0026001   .0010497     2.48   0.017     .0004907    .0047095
                              16  |   .0051237   .0011794     4.34   0.000     .0027536    .0074938
                              17  |   .0016329   .0011065     1.48   0.146    -.0005907    .0038564
                              18  |   .0042703   .0010979     3.89   0.000     .0020639    .0064767
                              19  |    .002133   .0008746     2.44   0.018     .0003753    .0038906
                              20  |    .007609   .0010244     7.43   0.000     .0055505    .0096675
                              21  |   .0052619   .0019619     2.68   0.010     .0013194    .0092044
                              22  |   .0075162   .0007361    10.21   0.000     .0060369    .0089955
                              23  |   .0033459   .0010144     3.30   0.002     .0013075    .0053843
                              24  |    .004164   .0017129     2.43   0.019     .0007218    .0076062
                              25  |   .0027783   .0012899     2.15   0.036     .0001862    .0053703
                              26  |   .0019426   .0010803     1.80   0.078    -.0002282    .0041135
                              27  |  -.0025211   .0010326    -2.44   0.018    -.0045962    -.000446
                              28  |  -.0022509   .0029135    -0.77   0.443    -.0081057    .0036039
                              29  |   .0033965   .0008736     3.89   0.000     .0016408    .0051521
                              30  |   .0055316   .0008349     6.63   0.000     .0038537    .0072094
                              31  |   .0027405   .0020428     1.34   0.186    -.0013647    .0068456
                              32  |   .0049305   .0013048     3.78   0.000     .0023085    .0075525
                              33  |  -.0063947   .0025226    -2.53   0.014    -.0114641   -.0013253
                              34  |  -.0241798   .0081089    -2.98   0.004    -.0404751   -.0078844
                              35  |   .0048407   .0008901     5.44   0.000     .0030521    .0066294
                              36  |   .0026411   .0007514     3.51   0.001      .001131    .0041512
                              37  |  -.0044607   .0009397    -4.75   0.000     -.006349   -.0025723
                              38  |  -.0039421   .0025961    -1.52   0.135    -.0091592    .0012749
                              39  |   .0052364   .0006986     7.50   0.000     .0038325    .0066402
                              40  |   .0075736   .0009112     8.31   0.000     .0057424    .0094048
                              41  |   .0003408   .0021817     0.16   0.877    -.0040434    .0047251
                              42  |    .005761   .0008264     6.97   0.000     .0041003    .0074216
                              43  |   .0042358   .0020712     2.05   0.046     .0000736    .0083979
                              44  |  -.0087242   .0029434    -2.96   0.005    -.0146392   -.0028093
                              45  |   -.008316   .0036498    -2.28   0.027    -.0156506   -.0009814
                              46  |   .0038452   .0022823     1.68   0.098    -.0007413    .0084316
                              47  |   .0044624   .0012987     3.44   0.001     .0018526    .0070722
                              48  |  -.0035475   .0029719    -1.19   0.238    -.0095196    .0024247
                              49  |   .0040496   .0012795     3.16   0.003     .0014783    .0066208
                              50  |    .003412   .0009316     3.66   0.001     .0015399    .0052842
                              51  |          0  (omitted)
                                  |
              state#c.year#c.year |
                               1  |          0  (omitted)
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                               4  |          0  (omitted)
                               5  |          0  (omitted)
                               6  |          0  (omitted)
                               7  |          0  (omitted)
                               9  |          0  (omitted)
                              10  |          0  (omitted)
                              11  |          0  (omitted)
                              12  |          0  (omitted)
                              13  |          0  (omitted)
                              14  |          0  (omitted)
                              15  |          0  (omitted)
                              16  |          0  (omitted)
                              17  |          0  (omitted)
                              18  |          0  (omitted)
                              19  |          0  (omitted)
                              20  |          0  (omitted)
                              21  |          0  (omitted)
                              22  |          0  (omitted)
                              23  |          0  (omitted)
                              24  |          0  (omitted)
                              25  |          0  (omitted)
                              26  |          0  (omitted)
                              27  |          0  (omitted)
                              28  |          0  (omitted)
                              29  |          0  (omitted)
                              30  |          0  (omitted)
                              31  |          0  (omitted)
                              32  |          0  (omitted)
                              33  |          0  (omitted)
                              34  |          0  (omitted)
                              35  |          0  (omitted)
                              36  |          0  (omitted)
                              37  |          0  (omitted)
                              38  |          0  (omitted)
                              39  |          0  (omitted)
                              40  |          0  (omitted)
                              41  |          0  (omitted)
                              42  |          0  (omitted)
                              43  |          0  (omitted)
                              44  |          0  (omitted)
                              45  |          0  (omitted)
                              46  |          0  (omitted)
                              47  |          0  (omitted)
                              48  |          0  (omitted)
                              49  |          0  (omitted)
                              50  |          0  (omitted)
                              51  |          0  (omitted)
                                  |
                            _cons |   22.35667   2.062577    10.84   0.000     18.21177    26.50157
              -------------------------------------------------------------------------------------


              Method 2:
              Code:
              Fixed-effects (within) regression               Number of obs     =      1,250
              Group variable: state                           Number of groups  =         50
              
              R-sq:                                           Obs per group:
                   within  = 0.9229                                         min =         25
                   between = 0.0002                                         avg =       25.0
                   overall = 0.0001                                         max =         25
              
                                                              F(17,49)          =          .
              corr(u_i, Xb)  = -1.0000                        Prob > F          =          .
              
                                                      (Std. Err. adjusted for 50 clusters in state)
              -------------------------------------------------------------------------------------
                                  |               Robust
                            lwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              --------------------+----------------------------------------------------------------
                          treated |  -.0382726   .0065913    -5.81   0.000    -.0515183   -.0250268
                                  |
                             year |
                            1984  |  -.0555126   .0046313   -11.99   0.000    -.0648196   -.0462056
                            1985  |  -.0815403   .0077592   -10.51   0.000    -.0971329   -.0659476
                            1986  |  -.0785557   .0093123    -8.44   0.000    -.0972693    -.059842
                            1987  |   -.110025   .0119546    -9.20   0.000    -.1340487   -.0860013
                            1988  |  -.1610242   .0141427   -11.39   0.000     -.189445   -.1326035
                            1989  |  -.2618081   .0148638   -17.61   0.000     -.291678   -.2319382
                            1990  |  -.3021409   .0173573   -17.41   0.000    -.3370217   -.2672601
                            1991  |  -.3512706   .0204661   -17.16   0.000    -.3923987   -.3101425
                            1992  |  -.3934975      .0243   -16.19   0.000    -.4423302   -.3446648
                            1993  |  -.4196494   .0283423   -14.81   0.000    -.4766055   -.3626934
                            1994  |  -.5700363   .0307412   -18.54   0.000     -.631813   -.5082595
                            1995  |  -.5970559    .034102   -17.51   0.000    -.6655863   -.5285254
                            1996  |  -.5020133   .0371361   -13.52   0.000     -.576641   -.4273855
                            1997  |  -.4976747   .0391774   -12.70   0.000    -.5764047   -.4189448
                            1998  |  -.4712658   .0416107   -11.33   0.000    -.5548856   -.3876459
                            1999  |  -.4850141   .0432868   -11.20   0.000    -.5720022    -.398026
                            2000  |  -.6209284   .0460284   -13.49   0.000     -.713426   -.5284309
                            2001  |   -.604501   .0489043   -12.36   0.000    -.7027779   -.5062241
                            2002  |  -.5895634   .0501188   -11.76   0.000    -.6902809   -.4888459
                            2003  |  -.5801771   .0530559   -10.94   0.000    -.6867969   -.4735572
                            2004  |   -.628801   .0547053   -11.49   0.000    -.7387355   -.5188665
                            2005  |  -.7564063   .0549042   -13.78   0.000    -.8667405   -.6460722
                            2006  |  -.7723675   .0591109   -13.07   0.000    -.8911552   -.6535798
                            2007  |  -.7776052   .0608049   -12.79   0.000    -.8997974   -.6554131
                                  |
                          college |   .0049949   .0006564     7.61   0.000     .0036758     .006314
                            metro |   .0001374    .000134     1.03   0.310     -.000132    .0004067
                             male |   .0018616    .001013     1.84   0.072     -.000174    .0038973
                            white |  -.0005209   .0007364    -0.71   0.483    -.0020007    .0009589
                             lpop |   .7204224   .2035838     3.54   0.001     .3113055    1.129539
                            lmile |          0  (omitted)
                       rtw_states |          0  (omitted)
                                  |
                            state |
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                               4  |          0  (omitted)
                               5  |          0  (omitted)
                               6  |          0  (omitted)
                               7  |          0  (omitted)
                               9  |          0  (omitted)
                              10  |          0  (omitted)
                              11  |          0  (omitted)
                              12  |          0  (omitted)
                              13  |          0  (omitted)
                              14  |          0  (omitted)
                              15  |          0  (omitted)
                              16  |          0  (omitted)
                              17  |          0  (omitted)
                              18  |          0  (omitted)
                              19  |          0  (omitted)
                              20  |          0  (omitted)
                              21  |          0  (omitted)
                              22  |          0  (omitted)
                              23  |          0  (omitted)
                              24  |          0  (omitted)
                              25  |          0  (omitted)
                              26  |          0  (omitted)
                              27  |          0  (omitted)
                              28  |          0  (omitted)
                              29  |          0  (omitted)
                              30  |          0  (omitted)
                              31  |          0  (omitted)
                              32  |          0  (omitted)
                              33  |          0  (omitted)
                              34  |          0  (omitted)
                              35  |          0  (omitted)
                              36  |          0  (omitted)
                              37  |          0  (omitted)
                              38  |          0  (omitted)
                              39  |          0  (omitted)
                              40  |          0  (omitted)
                              41  |          0  (omitted)
                              42  |          0  (omitted)
                              43  |          0  (omitted)
                              44  |          0  (omitted)
                              45  |          0  (omitted)
                              46  |          0  (omitted)
                              47  |          0  (omitted)
                              48  |          0  (omitted)
                              49  |          0  (omitted)
                              50  |          0  (omitted)
                              51  |          0  (omitted)
                                  |
                             year |          0  (omitted)
                                  |
                     state#c.year |
                               2  |   1.936379   .1852959    10.45   0.000     1.564013    2.308745
                               3  |   1.503604   .2436426     6.17   0.000     1.013986    1.993223
                               4  |   2.148227   .2085051    10.30   0.000      1.72922    2.567234
                               5  |   .2986172   .2741777     1.09   0.281    -.2523634    .8495978
                               6  |   1.172371   .2817482     4.16   0.000     .6061766    1.738565
                               7  |   3.833253   .1800583    21.29   0.000     3.471412    4.195093
                               9  |    2.23056   .2370954     9.41   0.000     1.754099    2.707021
                              10  |   1.966684   .1655509    11.88   0.000     1.633996    2.299371
                              11  |   2.935132   .2015799    14.56   0.000     2.530042    3.340222
                              12  |   3.521044   .2903489    12.13   0.000     2.937566    4.104522
                              13  |   2.573466   .2724581     9.45   0.000     2.025941    3.120991
                              14  |    3.70418   .4213648     8.79   0.000     2.857416    4.550944
                              15  |   2.845735   .2141673    13.29   0.000      2.41535     3.27612
                              16  |   3.941566   .2498288    15.78   0.000     3.439516    4.443615
                              17  |   .8267457   .1889731     4.37   0.000     .4469901    1.206501
                              18  |   3.063922   .2807597    10.91   0.000     2.499714    3.628129
                              19  |   .6329119   .2607301     2.43   0.019     .1089551    1.156869
                              20  |   3.495603   .1956781    17.86   0.000     3.102373    3.888832
                              21  |    2.55316    .161244    15.83   0.000     2.229128    2.877192
                              22  |   3.265805    .372694     8.76   0.000     2.516849    4.014762
                              23  |   3.059204    .147253    20.78   0.000     2.763288     3.35512
                              24  |   1.570282   .1674856     9.38   0.000     1.233707    1.906857
                              25  |   2.349027   .2270627    10.35   0.000     1.892728    2.805327
                              26  |   3.150521   .2387243    13.20   0.000     2.670787    3.630256
                              27  |   1.308291   .4172618     3.14   0.003     .4697714     2.14681
                              28  |   3.839569   .2090104    18.37   0.000     3.419547    4.259592
                              29  |   1.002939   .4194477     2.39   0.021     .1600271     1.84585
                              30  |   3.539309   .2922946    12.11   0.000     2.951921    4.126697
                              31  |   2.155773   .3748046     5.75   0.000     1.402575    2.908971
                              32  |   3.089361   .1574736    19.62   0.000     2.772905    3.405816
                              33  |   .4543869   .1983973     2.29   0.026     .0556926    .8530812
                              34  |   1.394732   .2845823     4.90   0.000     .8228425    1.966621
                              35  |   3.833486   .1920646    19.96   0.000     3.447518    4.219454
                              36  |   2.890463    .167575    17.25   0.000     2.553708    3.227217
                              37  |   .1638388   .4564164     0.36   0.721    -.7533643    1.081042
                              38  |   1.938984   .2376574     8.16   0.000     1.461394    2.416575
                              39  |   3.466286   .1776292    19.51   0.000     3.109326    3.823245
                              40  |   3.644357   .2288685    15.92   0.000     3.184428    4.104285
                              41  |   3.878219   .2198538    17.64   0.000     3.436407    4.320032
                              42  |   3.374835   .3585027     9.41   0.000     2.654397    4.095273
                              43  |   3.393864   .2208026    15.37   0.000     2.950145    3.837584
                              44  |    1.70279   .2981333     5.71   0.000     1.103669    2.301912
                              45  |   2.523345   .3107388     8.12   0.000     1.898892    3.147798
                              46  |   1.302569   .2042889     6.38   0.000      .892035    1.713103
                              47  |   3.089797   .1794328    17.22   0.000     2.729213     3.45038
                              48  |   .5129477     .27603     1.86   0.069    -.0417554    1.067651
                              49  |   2.574496   .2281925    11.28   0.000     2.115926    3.033066
                              50  |   2.578907   .3408982     7.57   0.000     1.893846    3.263967
                              51  |    .720812   .6215035     1.16   0.252    -.5281461     1.96977
                                  |
                    c.year#c.year |          0  (omitted)
                                  |
              state#c.year#c.year |
                               2  |  -.0004809   .0000464   -10.37   0.000    -.0005741   -.0003877
                               3  |  -.0003729    .000061    -6.12   0.000    -.0004954   -.0002504
                               4  |   -.000539   .0000523   -10.30   0.000    -.0006442   -.0004338
                               5  |  -.0000722   .0000686    -1.05   0.298    -.0002101    .0000657
                               6  |  -.0002918   .0000709    -4.11   0.000    -.0004343   -.0001492
                               7  |  -.0009552   .0000449   -21.25   0.000    -.0010455   -.0008649
                               9  |  -.0005559   .0000594    -9.36   0.000    -.0006753   -.0004365
                              10  |  -.0004913   .0000412   -11.92   0.000    -.0005741   -.0004085
                              11  |  -.0007335   .0000509   -14.42   0.000    -.0008357   -.0006313
                              12  |  -.0008792   .0000728   -12.07   0.000    -.0010255   -.0007328
                              13  |  -.0006398    .000068    -9.41   0.000    -.0007763   -.0005032
                              14  |  -.0009264   .0001058    -8.76   0.000     -.001139   -.0007138
                              15  |   -.000709   .0000535   -13.25   0.000    -.0008165   -.0006015
                              16  |  -.0009831   .0000625   -15.73   0.000    -.0011087   -.0008575
                              17  |  -.0002033   .0000473    -4.30   0.000    -.0002983   -.0001082
                              18  |  -.0007633   .0000701   -10.88   0.000    -.0009042   -.0006224
                              19  |  -.0001544    .000065    -2.38   0.021     -.000285   -.0000238
                              20  |  -.0008706   .0000489   -17.80   0.000    -.0009689   -.0007723
                              21  |  -.0006351   .0000405   -15.70   0.000    -.0007164   -.0005538
                              22  |   -.000813   .0000934    -8.70   0.000    -.0010008   -.0006253
                              23  |  -.0007623   .0000369   -20.65   0.000    -.0008365   -.0006881
                              24  |  -.0003891    .000042    -9.27   0.000    -.0004734   -.0003047
                              25  |  -.0005845   .0000568   -10.30   0.000    -.0006986   -.0004704
                              26  |  -.0007855   .0000597   -13.17   0.000    -.0009054   -.0006657
                              27  |   -.000325   .0001044    -3.11   0.003    -.0005349   -.0001151
                              28  |  -.0009596   .0000526   -18.25   0.000    -.0010652   -.0008539
                              29  |  -.0002468   .0001048    -2.35   0.023    -.0004574   -.0000361
                              30  |  -.0008821   .0000731   -12.07   0.000    -.0010289   -.0007352
                              31  |  -.0005362   .0000939    -5.71   0.000    -.0007249   -.0003475
                              32  |  -.0007695   .0000394   -19.55   0.000    -.0008486   -.0006904
                              33  |  -.0001121   .0000497    -2.25   0.029     -.000212   -.0000122
                              34  |  -.0003528     .00007    -5.04   0.000    -.0004936   -.0002121
                              35  |   -.000956   .0000479   -19.94   0.000    -.0010523   -.0008596
                              36  |  -.0007202   .0000419   -17.20   0.000    -.0008043    -.000636
                              37  |  -.0000378   .0001141    -0.33   0.742    -.0002672    .0001916
                              38  |  -.0004836   .0000595    -8.12   0.000    -.0006032    -.000364
                              39  |  -.0008638   .0000443   -19.50   0.000    -.0009529   -.0007748
                              40  |  -.0009079   .0000574   -15.82   0.000    -.0010233   -.0007926
                              41  |  -.0009685   .0000551   -17.58   0.000    -.0010792   -.0008578
                              42  |  -.0008408   .0000897    -9.37   0.000    -.0010211   -.0006605
                              43  |  -.0008461   .0000554   -15.28   0.000    -.0009574   -.0007348
                              44  |  -.0004256   .0000749    -5.68   0.000    -.0005762    -.000275
                              45  |  -.0006313   .0000783    -8.07   0.000    -.0007885    -.000474
                              46  |  -.0003221   .0000512    -6.29   0.000     -.000425   -.0002192
                              47  |  -.0007698   .0000451   -17.05   0.000    -.0008605   -.0006791
                              48  |  -.0001261    .000069    -1.83   0.074    -.0002647    .0000125
                              49  |  -.0006407   .0000572   -11.20   0.000    -.0007557   -.0005258
                              50  |  -.0006418   .0000848    -7.57   0.000    -.0008122   -.0004714
                              51  |  -.0001769   .0001553    -1.14   0.260     -.000489    .0001351
                                  |
                            _cons |  -2354.992   203.9645   -11.55   0.000    -2764.874    -1945.11
              --------------------+----------------------------------------------------------------
                          sigma_u |  1153.5661
                          sigma_e |  .02713741
                              rho |          1   (fraction of variance due to u_i)
              -------------------------------------------------------------------------------------

              Comment


              • #8
                The method by which Stata chooses which effects to omit when confronted with collinearity is not described in the documentation, and if you try to pursue it in the code, you find out that it is buried in machine-language code, and so, inaccessible to users. So the answer to your question why the two routines do it differently is, I don't know.

                But here's the important thing to understand is that once you have a big collinearity like this, none of the involved parameters is identifiable: they are simply artifacts of the particular way in which the collinearity is removed by imposing constraints (omissions of variables).

                Now, there is one thing you can do to reduce the collinearity here. Although from a strictly algebraic point of view, year, and year2 are not colinear, from a practical perspective, taking into account rounding and precision, they are. So you will have fewer things dropped if you center the continuous year variable. -gen year_centered = year - 1999- and then use c.year_centered##c.year_centered instead of c.year##c.year. You will still have some collinearities and this may still affect the estimate of treated--but if so that is because treated is itself involved in the collinearity so that its effect cannot be estimated. You have to simplify the model eliminating extraneous terms until you have no variables omitted except for the base category of each categorical variable.

                This may well mean that you will not be able to have both i.year and a quadratic model for year. If you think about it, given both the continuous value of year and an indicator for each separate year, you can calculate year^2 by assigning an appropriate coefficient to each year indicator (namely the value of the year itself). So you will need to think about which representation makes more sense for your purposes.

                Comment


                • #9
                  This makes so much sense now, thanks Clyde!

                  Comment

                  Working...
                  X