Announcement

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

  • Panel Data Regression on Gravity Model

    Hi everyone,

    I am doing an gravity model analysis on panel data of 10 countries for 30 years. This is my first time using Stata so I am not sure if I am doing this right. I am using the pooled OLS, random effects and fixed effects models.

    I first regressed for pooled OLS model


    reg ln_exports ln_distance ln_gdp_exporter ln_gdp_importer commonborder DAfta0 DAfta1 DAfta2 DAfta3 percentagetariffs noofNTMs DAfta0_percentagetariffs DAfta1_percentagetariffs DAfta2_percentagetariffs DAfta3_percentagetariffs DAfta0_noofNTMs DAfta1_noofNTMs DAfta2_noofNTMs DAfta3_noofNTMs

    Then I did the random effects model

    xtreg ln_exports ln_distance ln_gdp_exporter ln_gdp_importer commonborder DAfta0 DAfta1 DAfta2 DAfta3 percentagetariffs noofNTMs DAfta0_percentagetariffs DAfta1_percentagetariffs DAfta2_percentagetariffs DAfta3_percentagetariffs DAfta0_noofNTMs DAfta1_noofNTMs DAfta2_noofNTMs DAfta3_noofNTMs i.exporters i.importers i.year, re

    Then I did the Breush-Pagan LM test, and it pointed towards the random effects model.

    So I re-ran the random effects model, then estimates store re

    Then I ran the fixed effects model

    xtreg ln_exports ln_distance ln_gdp_exporter ln_gdp_importer commonborder DAfta0 DAfta1 DAfta2 DAfta3 percentagetariffs noofNTMs DAfta0_percentagetariffs DAfta1_percentagetariffs DAfta2_percentagetariffs DAfta3_percentagetariffs DAfta0_noofNTMs DAfta1_noofNTMs DAfta2_noofNTMs DAfta3_noofNTMs i.exporters i.importers i.year, fe

    estimates store fe

    hausman fe re, sigmamore

    My hausman results pointed towards the fixed effects model

    My questions are:

    1) am I doing it the right way?
    2) what about diagnostic tests? Does the robust option solves all the issues?

    I actually also read that the robust option would help with problems with diagnostic tests, but if I use the robust option with the fe and re commands, I cannot run the hausman test. I tried to use the xtoverid, but it came out with o. option not allowed.

    Please do help because I am not really well-versed in doing econometric analyses and I keep getting confused when reading other posts.

    Thank you in advance!






  • #2
    Amalina:
    welcome to this forum.
    The Statalist expert of this topic is Joao Santos Silva.
    See his posts on this forum.
    See also Joao and Silvana Tenreyro's paper at https://personal.lse.ac.uk/tenreyro/jensen08k.pdf.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you for the suggestion Dr Lazarro. I will look through it yet I would also appreciate comments if possible from anyone!

      Comment


      • #4
        Dear Amalina Mohsin,

        Can you please do let us know what is the purpose of your study? The kind of advice to provide very much depends on whether you are an undergrad student doing a first project, an adviser to a government, or something else.

        Best wishes,

        Joao

        Comment


        • #5
          Hi Dr Silva,

          I am a Masters student completing my studies, so this is my final paper submission.

          Comment


          • #6
            Dr. Carlo Lazzaro , i was reading related posts and saw that you said the fe vce (robust) option would deal with autocorrelation and heteroskedasticity. What is the difference between the fe robust and fe vce (robust) options?

            Comment


            • #7
              Amalina:
              no difference indeed, as you can see from the following toy-example:
              Code:
              . use "https://www.stata-press.com/data/r16/nlswork.dta"
              (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
              
              . xtreg ln_wage c.age##c.age, fe robust
              
              Fixed-effects (within) regression               Number of obs     =     28,510
              Group variable: idcode                          Number of groups  =      4,710
              
              R-sq:                                           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 |      Coef.   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)
              ------------------------------------------------------------------------------
              
              . xtreg ln_wage c.age##c.age, fe vce(robust)
              
              Fixed-effects (within) regression               Number of obs     =     28,510
              Group variable: idcode                          Number of groups  =      4,710
              
              R-sq:                                           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 |      Coef.   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)
              ------------------------------------------------------------------------------
              
              . 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-sq:                                           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 |      Coef.   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)
              ------------------------------------------------------------------------------
              
              .
              As an aside, please call me Carlo, like all on (and many more off) this forum do. Thanks.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Dear Amalina Mohsin,

                Thank you for the additional information. In that case, I suggest that you follow the standard approach in the field and use a "structural" gravity with the so called origin-time and destination-time fixed effects to account for multilateral resistance. For details, see this short and free book. Also, as you may guess from the paper Carlo recommended, I suggest you estimate the model using Poisson regression. The command ppmlhdfe allows you to estimate the model I am suggesting and is reasonably simple to use (check the help file).

                Finally, note that you have a very small number of countries, so be careful with the interpretation of your results because they may not apply to other countries.

                Best of luck,

                Joao

                Comment


                • #9
                  thank you so much for the very helpful answers Carlo Carlo Lazzaro and Joao Santos Silva ! I will go through all the links given and consider the ppml approach. Very much appreciated!

                  Comment

                  Working...
                  X