Announcement

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

  • #16
    Thank you so much Carlo, I will use that command.

    Best,
    Shiwani

    Comment


    • #17
      Thank you so much Carlo, I will use that command.

      Best,
      Shiwani

      Comment


      • #18
        Hi Carlo,

        I am working on a panel data model, and I want to control for year and industry fixed effects. I tried to google about this conceptual difference, but I have had no luck finding clarity on this. I also searched the forum and took a look at Otoress presentation on panel data, but I am still having some conceptual confusions regarding the following models. So, I am asking it here because it relates to fixed effects:


        Model 1: regress indep_VAR dep_VAR i.year i.industry, vce(cluster firm_id)

        Model 2: xtreg indep_VAR dep_VAR i.industry, fe vce(cluster firm_id)

        Model 3: regress indep_VAR dep_VAR i.year i.industry i.gvkey, vce(cluster firm_id)

        Conceptually, isn't Model 2 same as model 3? or Is model 2 same as Model 3? When I estimate these three models and compare the results they look quite different. Do you know which among these three models are almost the same thing? Which of the above model is closest to what I am looking for? I would be super grateful for any clarification on this. I am very sorry if I am missing a simple point in this. Thank you!

        Sincerely,

        Shiwani

        Comment


        • #19
          Shiwani:
          if you want to compare -regress- and -xtreg,fe-, you can tae a look at the following toy-example (default standard errors):
          Code:
          . use "https://www.stata-press.com/data/r16/nlswork.dta"
          (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
          . regress ln_wage age i.year i.idcode if idcode<=4
          
                Source |       SS           df       MS      Number of obs   =        50
          -------------+----------------------------------   F(18, 31)       =      1.19
                 Model |  2.96881764        18  .164934314   Prob > F        =    0.3290
              Residual |  4.31127709        31  .139073454   R-squared       =    0.4078
          -------------+----------------------------------   Adj R-squared   =    0.0639
                 Total |  7.28009473        49  .148573362   Root MSE        =    .37293
          
          ------------------------------------------------------------------------------
               ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   age |   .2626399   .4488774     0.59   0.563    -.6528517    1.178131
                       |
                  year |
                   69  |  -.0536729   .6925589    -0.08   0.939    -1.466156     1.35881
                   70  |  -.5622491   .9779883    -0.57   0.570    -2.556869    1.432371
                   71  |  -.9270145   1.387092    -0.67   0.509    -3.756008    1.901979
                   72  |  -1.063298   1.819443    -0.58   0.563    -4.774076     2.64748
                   73  |  -1.228195   2.258252    -0.54   0.590     -5.83393     3.37754
                   75  |  -1.704501   3.144409    -0.54   0.592    -8.117565    4.708562
                   77  |  -2.312608   4.040225    -0.57   0.571     -10.5527    5.927484
                   78  |  -2.367822   4.486708    -0.53   0.601    -11.51852     6.78288
                   80  |  -3.040105   5.376662    -0.57   0.576    -14.00588     7.92567
                   82  |  -3.763953   6.275703    -0.60   0.553    -16.56333    9.035427
                   83  |  -3.803244   6.719895    -0.57   0.575    -17.50856    9.902073
                   85  |  -4.165837   7.616051    -0.55   0.588    -19.69888     11.3672
                   87  |  -4.750318   8.512544    -0.56   0.581    -22.11177    12.61113
                   88  |  -5.133582   9.297175    -0.55   0.585     -24.0953    13.82813
                       |
                idcode |
                    2  |    -.34821   .1544058    -2.26   0.031    -.6631228   -.0332973
                    3  |  -1.996997   2.662102    -0.75   0.459     -7.42639    3.432395
                    4  |  -1.597003   2.699068    -0.59   0.558    -7.101788    3.907781
                       |
                 _cons |  -2.287519   7.228638    -0.32   0.754    -17.03042    12.45539
          ------------------------------------------------------------------------------
          
          . xtreg ln_wage age i.year if idcode<=4, fe
          
          Fixed-effects (within) regression               Number of obs     =         50
          Group variable: idcode                          Number of groups  =          4
          
          R-sq:                                           Obs per group:
               within  = 0.1909                                         min =         11
               between = 0.0349                                         avg =       12.5
               overall = 0.0044                                         max =         15
          
                                                          F(15,31)          =       0.49
          corr(u_i, Xb)  = -0.9582                        Prob > F          =     0.9290
          
          ------------------------------------------------------------------------------
               ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   age |   .2626399   .4488774     0.59   0.563    -.6528517    1.178131
                       |
                  year |
                   69  |  -.0536729   .6925589    -0.08   0.939    -1.466156     1.35881
                   70  |  -.5622491   .9779883    -0.57   0.570    -2.556869    1.432371
                   71  |  -.9270145   1.387092    -0.67   0.509    -3.756008    1.901979
                   72  |  -1.063298   1.819443    -0.58   0.563    -4.774076     2.64748
                   73  |  -1.228195   2.258252    -0.54   0.590     -5.83393     3.37754
                   75  |  -1.704501   3.144409    -0.54   0.592    -8.117565    4.708562
                   77  |  -2.312608   4.040225    -0.57   0.571     -10.5527    5.927484
                   78  |  -2.367822   4.486708    -0.53   0.601    -11.51852     6.78288
                   80  |  -3.040105   5.376662    -0.57   0.576    -14.00588     7.92567
                   82  |  -3.763953   6.275703    -0.60   0.553    -16.56333    9.035427
                   83  |  -3.803244   6.719895    -0.57   0.575    -17.50856    9.902073
                   85  |  -4.165837   7.616051    -0.55   0.588    -19.69888     11.3672
                   87  |  -4.750318   8.512544    -0.56   0.581    -22.11177    12.61113
                   88  |  -5.133582   9.297175    -0.55   0.585     -24.0953    13.82813
                       |
                 _cons |  -3.321529   8.616061    -0.39   0.702     -20.8941    14.25104
          -------------+----------------------------------------------------------------
               sigma_u |  .96166721
               sigma_e |  .37292553
                   rho |  .86927679   (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          F test that all u_i=0: F(3, 31) = 4.30                       Prob > F = 0.0120
          
          .
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #20
            Please have a review of my results and please suggest that what interpretation i may need to write if I got the result that "2.Country omitted because of collinearity"
            The command I have run:

            xtreg BSPI RCTRWA T1CTRWA NPLP CTA NPLTGL FCDLTo ROA IMTGI PETNIE LATA LATSTL OP INT ER IR i.Country, fe


            The result I got:

            note: 2.Country omitted because of collinearity
            note: 3.Country omitted because of collinearity
            note: 4.Country omitted because of collinearity
            note: 5.Country omitted because of collinearity
            note: 6.Country omitted because of collinearity
            note: 7.Country omitted because of collinearity
            note: 8.Country omitted because of collinearity
            note: 9.Country omitted because of collinearity
            note: 10.Country omitted because of collinearity
            note: 11.Country omitted because of collinearity
            note: 12.Country omitted because of collinearity
            note: 13.Country omitted because of collinearity
            note: 14.Country omitted because of collinearity
            note: 15.Country omitted because of collinearity
            note: 16.Country omitted because of collinearity
            note: 17.Country omitted because of collinearity
            note: 18.Country omitted because of collinearity
            note: 19.Country omitted because of collinearity
            note: 20.Country omitted because of collinearity
            note: 21.Country omitted because of collinearity
            note: 22.Country omitted because of collinearity
            note: 23.Country omitted because of collinearity
            note: 24.Country omitted because of collinearity
            note: 25.Country omitted because of collinearity

            Fixed-effects (within) regression Number of obs = 1,029
            Group variable: Country Number of groups = 25

            R-sq: Obs per group:
            within = 0.4041 min = 28
            between = 0.0088 avg = 41.2
            overall = 0.1519 max = 48

            F(15,989) = 44.72
            corr(u_i, Xb) = -0.4240 Prob > F = 0.0000


            BSPI Coef. Std. Err. t P>t [95% Conf. Interval]

            RCTRWA -217.2987 31.14835 -6.98 0.000 -278.4231 -156.1742
            T1CTRWA 168.6506 33.13342 5.09 0.000 103.6308 233.6705
            NPLP .3135463 .3453415 0.91 0.364 -.3641399 .9912324
            CTA 82.45599 26.26966 3.14 0.002 30.90532 134.0067
            NPLTGL -8.699677 4.988882 -1.74 0.082 -18.48969 1.090334
            FCDLTo -18.26241 7.370027 -2.48 0.013 -32.7251 -3.799723
            ROA 178.1742 21.82474 8.16 0.000 135.3461 221.0023
            IMTGI .00247 .0016268 1.52 0.129 -.0007225 .0056624
            PETNIE 1.098361 5.403764 0.20 0.839 -9.505799 11.70252
            LATA 28.47131 5.295798 5.38 0.000 18.07902 38.8636
            LATSTL .9037557 1.407376 0.64 0.521 -1.85803 3.665541
            OP -.0001435 .0002311 -0.62 0.535 -.0005971 .00031
            INT 17.8698 8.793821 2.03 0.042 .6131109 35.12649
            ER .0302935 .0490917 0.62 0.537 -.0660424 .1266295
            IR 26.28598 1.361805 19.30 0.000 23.61362 28.95834

            Country
            2 0 (omitted)
            3 0 (omitted)
            4 0 (omitted)
            5 0 (omitted)
            6 0 (omitted)
            7 0 (omitted)
            8 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)

            _cons -1152.319 357.7763 -3.22 0.001 -1854.407 -450.231

            sigma_u 1028.1494
            sigma_e 729.64212
            rho .6650594 (fraction of variance due to u_i)

            F test that all u_i=0: F(24, 989) = 36.19 Prob > F = 0.0000

            Comment


            • #21
              Bilal:
              -country- is collinear with fixed effect (or possibly is the fixed effect of your panel data regression; you do not report how you -xtset- your data, so I cannot tell).
              It's apparent that your panel data regression needs a different specification.
              Two asides:
              - please use CODE delimyers to post what you typed an what Stata gave you back (as per FAQ);
              - please do not write forum members privately urging for a reply: oftentimes, you obtain the opposite effect, as posting or replying on this forum is nobody's obligation. Thanks.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #22
                thanks carlo

                Comment

                Working...
                X