Announcement

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

  • Gravity Equation: Panel and PPML

    Good morning Mr. Joao Santos Silva ,

    I am doing a panel data model to represent the effects of FTAs (Trade Creation and Trade Diversion) in Trade Flows (Exports and Imports) for Peru and the 90% of its trading partners (from 1995 to 2015). Im using the PPML estimator to estimate the model and also I have been added some year and country-pair dummy variables.

    Previously, I estimate my model using FE estimator (according to panel theory), and I obtained some time-invariant variables drop out (as case of distance, language, etc.). So, I would like to ask you why, in the case of PPML estimation, does not drop out the time-invariant variables?

    Thanks very much for the atention, Mr. Santos.
    Last edited by Gabriel Arrieta; 24 Jan 2018, 10:43.

  • #2
    Dear Gabriel,

    That depends on how you are estimating your model. If you have fixed effects, I recommend that you use -xtpoisson- with clustered standard errors and if you do that all the time invariant variables will drop.

    Best wishes,

    Joao

    Comment


    • #3
      Dear Prof. Santos Silva,

      Thank you very much for your answer.

      And I have some related questions:

      - Can I consider this estimation method (xtpoisson) as a special case of PPML estimator (for panel fixed effects PPML estimation)? Or are both different estimators?

      - If I am using year and country-pair dummy variables, Should be considered (these dummy variables) as fixed effects modelling?

      - If I consider to drop out with my FE estimation, all the time invariant variables? How can handle with my "distance" variable that is very important for my Gravity equation analysis? Should I use Random Effects to obtain an estimated coefficient for distance?

      All the best,
      Gabriel

      Comment


      • #4
        Dear Gabriel,

        1) xtppml is indeed a PPML estimator

        2) Indeed, people now call fixed effects to those dummies

        3) Do not use random effects; if you use pair-fixed effects the coefficient of distance cannot be identified. Many models do not include pair-fixed effects.

        Best wishes,

        Joao

        Comment


        • #5
          Dear Prof. Santos Silva,

          So, can I estimate my model using xtppml, that is the same "xtpoisson" or "xtpqml"?

          Thank you for your answers and your helpful comments professor.

          Best regards,
          Gabriel

          Comment


          • #6
            Sorry, I meant xtpoisson; xtppml does not exist (AFAIK). xtpqml should give the same results as xtpoisson.

            Comment


            • #7
              Dear Prof. Santos Silva,

              Thank you very much for your helpful comments and suggestions.

              Best regards,
              Gabriel

              Comment


              • #8
                Originally posted by Joao Santos Silva View Post
                Sorry, I meant xtpoisson; xtppml does not exist (AFAIK). xtpqml should give the same results as xtpoisson.
                Dear Prof. Santos Silva,

                I just notice that this xtpoisson estimator does not report R-squared value. How can I obtain it?

                Thank you very much.

                Best regards,
                Gabriel

                Comment


                • #9
                  Here is an example of how to do it

                  Code:
                  clear all
                  sysuse auto
                  xtset rep78
                  xtpoisson price mpg , fe
                  predict double xb if e(sample)==1
                  g double yhat=exp(xb)
                  egen meany=mean(price) if e(sample)==1, by(rep78)
                  egen meanyhat=mean(yhat) , by(rep78)
                  gen double exp_alpha=meany/meanyhat  
                  replace yhat=yhat*exp_alpha
                  qui corr yhat price
                  di "R2 = " r(rho)^2
                  All the best,

                  Joao

                  Comment


                  • #10
                    Hello,

                    I am using PPML to estimate the determinants of export.
                    My ppml estimation commands are;


                    ppml exports_son lgdp_reporter lgdp_partner lpop_reporter lpop_partner lland_reporter lland_partner ldist colony contig comlang_off , cluster(pairid)

                    ppml exports_son lgdp_reporter lgdp_partner lpop_reporter lpop_partner lland_reporter lland_partner ldist colony contig comlang_off year_*, cluster(pairid)

                    ppml exports_son lgdp_reporter lgdp_partner lpop_reporter lpop_partner lland_reporter lland_partner ldist colony contig comlang_off year_* reporter_* partner_*,cluster(pairid)

                    xtpqml exports_son lgdp_reporter lgdp_partner lpop_reporter lpop_partner lland_reporter lland_partner ldist colony contig comlang_off year_*, fe cluster(pairid)


                    I have 2 questions,

                    1)Are the commands correct for ppml est.?

                    2) And second i want to get the predicted value of exports. But i don know which stata command /commands i need to use for prediction.

                    I will be very glad if somebodys answering my questions.

                    Best

                    Comment


                    • #11
                      Dear Merve,

                      1) The commands you give estimate models with different sets of fixed effects and they look correct (if those are the regressors and fixed effects you want to include).

                      2) With ppml you can get predictions using the predict command after the estimation. With xtpqml things are a bit more complicated, but you can get them as in #9 above (the predicted values are in yhat in the penultimate line).

                      Best wishes,

                      Joao

                      Comment


                      • #12
                        Dear Joao,

                        Thank you very much for your answer.

                        I used firstly "ppml exports lgdp_reporter lgdp_partner lpop_reporter lpop_partner lland_reporter lland_partner ldist colony contig comlang_off year_* reporter_* partner_*,cluster(pairid)" and than "predict mu" commands. And a mu column appeared showed like below.

                        As i understand for ex. " In 2001 Predicted value of export is 2901813 from Tur. to Aut. " Is it correct or not?

                        Thanks for instance,

                        Best Wishes.

                        year reporter partner mu
                        2001 TUR AUT 2901813
                        2002 TUR AUT 3313635
                        2003 TUR AUT 3952249
                        2004 TUR AUT 5004043
                        2005 TUR AUT 6210501
                        2006 TUR AUT 7298055
                        2007 TUR AUT 8382143
                        2008 TUR AUT 8662180
                        2009 TUR AUT 9155061
                        2010 TUR AUT 8143444
                        2011 TUR AUT 9238369
                        2012 TUR AUT 1.03E+07
                        2013 TUR AUT 1.06E+07
                        2014 TUR AUT 1.13E+07
                        2015 TUR AUT 1.13E+07
                        2016 TUR AUT 1.14E+07

                        Comment


                        • #13
                          That is correct.

                          Comment


                          • #14
                            Thank you very much for your helpful comments..

                            Best Regards

                            Comment


                            • #15
                              Originally posted by Merve Kadiroglu View Post
                              Dear Joao,

                              Thank you very much for your answer.

                              I used firstly "ppml exports lgdp_reporter lgdp_partner lpop_reporter lpop_partner lland_reporter lland_partner ldist colony contig comlang_off year_* reporter_* partner_*,cluster(pairid)" and than "predict mu" commands. And a mu column appeared showed like below.

                              As i understand for ex. " In 2001 Predicted value of export is 2901813 from Tur. to Aut. " Is it correct or not?

                              Thanks for instance,

                              Best Wishes.

                              year reporter partner mu
                              2001 TUR AUT 2901813
                              2002 TUR AUT 3313635
                              2003 TUR AUT 3952249
                              2004 TUR AUT 5004043
                              2005 TUR AUT 6210501
                              2006 TUR AUT 7298055
                              2007 TUR AUT 8382143
                              2008 TUR AUT 8662180
                              2009 TUR AUT 9155061
                              2010 TUR AUT 8143444
                              2011 TUR AUT 9238369
                              2012 TUR AUT 1.03E+07
                              2013 TUR AUT 1.06E+07
                              2014 TUR AUT 1.13E+07
                              2015 TUR AUT 1.13E+07
                              2016 TUR AUT 1.14E+07


                              Dear Mr. Joao

                              My question is about the possibility of predicting values out of sample data with a PPML model. Is this possible? Is there a command to execute in Stata?

                              Comment

                              Working...
                              X