Announcement

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

  • Hausman test Panel gravity model

    Hello
    I am running a panel with 120 countries over 15 years (a gravity model with 5 dummie s and other variables...).
    Hausman test suggests i should use FE model however when i run RE models i find better outcome ( coefficient values/ signs; Rsquared almost 90%...)
    should I use FE instead?

    Kind Regards,

  • #2
    Mariem:
    welcome to this forum.
    Hunting for "better outcome" (whatever that means) should not be your main goal.
    If, as per -hausman- outcome, -fe- specification fits your data better than -re-, go -fe-.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Dear mariem omar,

      Carlo provided excellent advice, but let me try to add to it. The test you are performing is valid only under homoskedasticity and therefore it is unlikely to be valid in this context. Having said that, I generally would not recommend the RE estimator in this context because it is very sensitive to departures from its strong assumptions. In any case, estimating a gravity equation using any of these methods is likely to lead to unreliable results; have you considered using PPML with fixed effects?

      Best wishes,

      Joao

      Comment


      • #4
        Thank you for your responses!
        I run the Modified Wald test and i figured out the presence of heteroskedasticity! so I guess that's why Hausman test isn't valid..I run Breusch and Pagan Lagrangian multiplier test for random effects and it recommended the use of random effect model.
        And what is the PPML with fixed effects! ( I am a beginner ...)

        Thank you!

        Kind Regards


        Comment


        • #5
          Mariem:
          a significant -xttest0- does not necessary mean that -re- is the best specification for your data, as you can see from the following toy-example:
          Code:
          . use "http://www.stata-press.com/data/r15/nlswork.dta"
          (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
          
          . xtreg ln_wage age, fe
          
          Fixed-effects (within) regression               Number of obs     =     28,510
          Group variable: idcode                          Number of groups  =      4,710
          
          R-sq:                                           Obs per group:
               within  = 0.1026                                         min =          1
               between = 0.0877                                         avg =        6.1
               overall = 0.0774                                         max =         15
          
                                                          F(1,23799)        =    2720.20
          corr(u_i, Xb)  = 0.0314                         Prob > F          =     0.0000
          
          ------------------------------------------------------------------------------
               ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   age |   .0181349   .0003477    52.16   0.000     .0174534    .0188164
                 _cons |   1.148214   .0102579   111.93   0.000     1.128107     1.16832
          -------------+----------------------------------------------------------------
               sigma_u |  .40635023
               sigma_e |  .30349389
                   rho |  .64192015   (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          F test that all u_i=0: F(4709, 23799) = 8.81                 Prob > F = 0.0000
          
          . estimates store fe
          
          . xtreg ln_wage age, re
          
          Random-effects GLS regression                   Number of obs     =     28,510
          Group variable: idcode                          Number of groups  =      4,710
          
          R-sq:                                           Obs per group:
               within  = 0.1026                                         min =          1
               between = 0.0877                                         avg =        6.1
               overall = 0.0774                                         max =         15
          
                                                          Wald chi2(1)      =    3140.35
          corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
          
          ------------------------------------------------------------------------------
               ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   age |   .0185667   .0003313    56.04   0.000     .0179174    .0192161
                 _cons |   1.120439   .0112038   100.01   0.000      1.09848    1.142398
          -------------+----------------------------------------------------------------
               sigma_u |  .36972456
               sigma_e |  .30349389
                   rho |  .59743613   (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          
          . xttest0
          
          Breusch and Pagan Lagrangian multiplier test for random effects
          
                  ln_wage[idcode,t] = Xb + u[idcode] + e[idcode,t]
          
                  Estimated results:
                                   |       Var     sd = sqrt(Var)
                          ---------+-----------------------------
                           ln_wage |   .2285836       .4781042
                                 e |   .0921085       .3034939
                                 u |   .1366963       .3697246
          
                  Test:   Var(u) = 0
                                       chibar2(01) = 28235.40
                                    Prob > chibar2 =   0.0000
          
          . estimates store re
          
          . hausman fe re
          
                           ---- Coefficients ----
                       |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                       |       fe           re         Difference          S.E.
          -------------+----------------------------------------------------------------
                   age |    .0181349     .0185667       -.0004318        .0001055
          ------------------------------------------------------------------------------
                                     b = consistent under Ho and Ha; obtained from xtreg
                      B = inconsistent under Ha, efficient under Ho; obtained from xtreg
          
              Test:  Ho:  difference in coefficients not systematic
          
                            chi2(1) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                                    =       16.76
                          Prob>chi2 =      0.0000
          Despite a highly significant outcome of the -xttest0- -fe- seems the way to go according to -hausman- outcome.
          As an aside, if you detect heteroskedasticity and wisely take it into account via cluster robust standard errors, the user-written programme -xtoverid- shoudl take the place of -hausman-, as the latter allows default standard errors only.
          Kind regards,
          Carlo
          (Stata 18.0 SE)

          Comment


          • #6
            Dear Carlo Lazzaro and Joao Santos Silva !
            I am using a panel gravity model at sectoral level. I have organised my panel by running the following codes
            Code:
            egen pair_id = group (Importer Exporter Sector)
            xtset pair_id Year
            To check whether I should use Fixed effects of Random effects models, I am running a Hausman test using two different approaches :

            (1) First Method - Hausman test

            Code:
            xtreg ln_imports covariates, fe i(pair_id)
            estimate store fe
            xtreg xtreg ln_imports covariates, re i(pair_id)
            estimate store re
            hausman fe re
            Next, I am generating a set of Importer, Exporter and Year Fixed Effects, by running the following codes :

            Code:
            egen imp_1 = group(iso_i)
            tabulate imp_1, generate(IMP_FE)
            egen exp_1 = group(iso_e)
            tabulate exp_1, generate(EXP_FE)
            egen Year_1 = group(Year)
            tabulate Year_1, generate(Year_FE)
            where IMP_FE, EXP_FE, and Year_FE are Importer, Exporter and Year Fixed Effects respectively

            (2) Second Method- Hausman test

            In this case, I am running a Fixed Effects regression using these set of Fixed effects and all other covariates
            Code:
            xtreg ln_imports covariates EXP_FE* IMP_FE* Year_FE*,  fe i(pair_id)
            estimate store fe
            xtreg ln_imports covariates, re i(pair_id)
            estimate store re
            hausman fe re
            Both the methods however favors Fixed effects model, but the coefficients of covariates are different in Fixed effect regression under the two methods.

            I want to ask what is the right way to test Hausman-test ? Whether I should go with First Method or Second Method? or any other suggestion may be useful.

            Thanks and Regards
            (Ridwan)

            Comment


            • #7
              Dear Ridwan Sheikh,

              In this context, ignore the RE model and just use FE. You should, however, use PPML rather than OLS in logs.

              Best wishes,

              Joao

              Comment


              • #8
                Thanks Joao Santos Silva
                I am using PPML as it adress the zero-trade and heterogeneity in trade flows well .
                Thanks for sharing the article "the log of gravity" earlier with me on this forum, it was very useful read .
                Yes FE's is the likely strategy and I shall keep that in mind (thanks).
                Since I am writing a PhD dissertation , I was here mentioning FE vs RE with Hausman test , just for expositional purpose .

                Thanks and Regards (Ridwan)


                Comment


                • #9
                  how did you solve it?

                  Comment


                  • #10
                    While running the PPML method for gravity model, can the dependent variable be transformed into log form or should it strictly be at level?

                    Comment


                    • #11
                      In levels; that is the advantage of PPML.

                      Comment


                      • #12
                        Joao Santos Silva
                        Thank you Sir.

                        I am doing an analysis of determinants of/ impact of different determinants on Indian trade (i.e. exports and imports) with 10 ASEAN countries for the period 1997-2021.
                        For Indian Exports, I have 10-panel ids. India is the exporter and the 10 countries of ASEAN are importers. Therefore, the total no. of observations is 1*10*25=250. Can PPML be applied to this dataset or should I also include the data of ASEAN countries' exports to India?
                        Last edited by SABA GULNAZ; 11 Dec 2022, 02:55.

                        Comment


                        • #13
                          I am doing an analysis of determinants of/ impact of different determinants on Indian trade (i.e. exports and imports) with 10 ASEAN countries for the period 1997-2021.
                          For Indian Exports, I have 10-panel ids. India is the exporter and the 10 countries of ASEAN are importers. Therefore, the total no. of observations is 1*10*25=250. Can PPML be applied to this dataset or should I also include the data of ASEAN countries' exports to India?

                          Comment


                          • #14
                            Dear SABA GULNAZ,

                            PPML can be applied to any dataset; it is up to you to decide whether your dataset is suitable to address the question you are considering.

                            Best wishes,

                            Joao

                            Comment


                            • #15
                              Dear Joao Santos Silva
                              when using PPML fixed effect (country-pair and year FE), does the PPML regression dummy variable of FE need to be interpreted??
                              Is there any paper that can be used as a reference

                              Comment

                              Working...
                              X