Announcement

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

  • Using stata for Gravity model

    Please I am writing my thesis for my masters program. I am estimating the gravity model and I need guidance on the command to use. firstly I have dummy variables, some bilateral, while some are country specific. I guess this means I am using a random effects approach right?. Also when trying to estimate the regression equation, I want to use the Pseudo Poisson Maximum Likelihood (ppml).so i installed ppml on stata and ran the command like this 'ppml dependent variable independent variable. unfortunately the main variable came out with a sign that was not expected. Then I used xtpoisson dependent variable independent variable and i got another result. Please which command is right? and is there something else I am supposed to do that I am not doing?

  • #2
    Dear Ella,

    The difference between -ppml- and -xtpoisson- is that the latter automatically includes pair fixed effects whereas the former does not. You will get the same results if you explicitly include the fixed effect dummies in the list of regressors used by -ppml-. As for whether or not you want to include pair fixed effects, that is something that you should discuss with your advisor and decide accordingly. Finally, random effects models are generally not interesting in this context.

    Best regards,

    Joao

    Comment


    • #3
      Have a look at the references cited in the following thread:
      http://www.statalist.org/forums/foru...-heterogeneity

      Comment


      • #4
        Thank you for your reply Joao Silva. However I tried what the commands like you said. I dropped all the country pair dummy variables with the xtpoisson command. But they are giving me different Annwers

        Comment


        • #5
          Dear Ella,

          Please post the commands you are using and the results you get, OK?

          Joao

          Comment


          • #6
            Thank you Mr. Santos. I will. But before I do that, Please a quick question. So i am actually modelling one way trade. It is Nigeria's export to its 20 largest export partners. I have dummy variables for common lang, common coloniser,and common religion and belonging to the wto. Then I have a dummy variable if the partners belong to the eu. another dummy variable capturing the years of the financial crisis. Then I have the usual variables of GDP, tariff and my main variable of interest real exchange rate. I want to ask, in this situation should i control for just country fixed effects or country year fixed effect. second question; because of the presence of bilateral time invariant dummies, this means i cant control for county pair fixed effects right?

            Comment


            • #7
              Also Mr. Santos, I have tried so many commands I am so confused. Each of them giving me different results
              1. xi: ppml export year lang rel ccmon gfc fta lntwp mend lnprodgdpc lnprodgdp lnrlxrtindex i.dcode, cluster(dcode)
              2. xi: ppml export year lang rel ccmon gfc fta lntwp mend lnprodgdpc lnprodgdp lnrlxrtindex i.dcode,
              3. ppml export year lang rel ccmon gfc fta lntwp mend lnprodgdpc lnprodgdp lnrlxrtindex
              4.xtpoisson export lnprodgdpc lnprodgdp lntwp lnrlxrtindex
              5. xtpoisson export year lang rel ccmon gfc mend lnprodgdpc lnprodgdp lntwp lnrlxrtindex i.dcode.
              these are just some of the commands I have tried. Please help me.

              Comment


              • #8
                Dear Ella,

                Because you are just looking at exports from one country, the pair fixed effects I mentioned above are just destination fixed effects. So, you should get the same results if you do either of the following:
                Code:
                 xi: ppml export year lang rel ccmon gfc fta lntwp mend lnprodgdpc lnprodgdp lnrlxrtindex i.dcode, cluster(dcode)
                xtpoisson export year lang rel ccmon gfc fta lntwp mend lnprodgdpc lnprodgdp lnrlxrtindex, i(dcode) cluster(dcode)
                I am not going to comment on the details of the specification you should use because I do not have enough information to do it; you should discuss that with your adviser.

                Best wishes,

                Joao

                Comment


                • #9
                  Thank you Professor Santos. I will go through the commands and revert back again.

                  Comment


                  • #10
                    Dear Professor Santos,

                    I have a similar question. I tried to read as many of your answers on the forum as possible but I am still not sure what kind of command to use in my case. In my Barchelor thesis I am trying to estimate the potential level of intraregional trade in Latin America using a gravity equation for 135 countries over the period from 1994 to 2014. Here is my model in a multiplicative form (level-log):

                    ppml trade lgdp_rep lgdp_par lpop_rep lpop_par ldist remoteness_rep remoteness_par comlang_off colony contig landlocked_rep landlocked_par rta LA_rep comm_dep_rep LA_rep_and_par comm_dep_rep_after_2003 comm_dep_rep_after_2013, robust cluster(dist)

                    - "rep" and "par" stand for reporter and partner countries respectively
                    - "LA_rep" equals 1 if the reporting country is in Latin America
                    - "comm_dep_LA_rep" equals 1 if the reporting country is in Latin America and is commodity dependent (commodities constitute >60% of total exports as of 2014)
                    - "LA_rep_and_par" equals 1 if both the reporting and partner countries are in Latin America


                    "comm_dep_rep" and "LA_rep_and_par" are my key variables of interest. With the first one I would like to show how commodity dependent Latin American countries are predicted to trade more than similar non-commodity dependent countries, while the second one would show me if intraregional trade in Latin America is below/above its potential level.

                    I tried to use the "ppml" command but I didn't get the results that I expected. Also, I am not quite sure if I should include any time fixed effects (dummies for each of the 20 years). Any help regarding an appropriate estimation technique would be greatly appreciated!

                    Thanks very much in advance!

                    Regards,
                    Timofei

                    Comment


                    • #11
                      Dear Timofei,

                      I do not think the option -robust- is available in -ppml-. As for the inclusion of fixed effects, you are the one that needs to decide on that (discuss it with your supervisor). If there are any particular results that you find strange, please post them and I'll try to have a look.

                      All the best,

                      Joao

                      Comment


                      • #12
                        Dear Professor Santos Silva,

                        We are a team of undergrad students working on an estimation of the potential impact on trade from Gran Britain´s exit from the EU. Naturally, we came across your PPML estimation method after finding strong evidence of heteroskedasticity in our sample, but we haven´t quite figured out how the different coefficients can be interpreted. We are not sure if the raw coefficients (not margins) can be interpreted as simple elasticities, like in a simple log-linearized OLS model. Moreover, we would really appreciate any indication you could give us on how to perform the subsequent estimation.

                        Thank you all your hard work on this topic, it has been really helpful

                        Warm regards,

                        Belén

                        Comment


                        • #13
                          Dear Belén,

                          Thank you for your interest in our work.

                          The interpretation of the coefficients when you estimate by PPML is exactly the same as when you estimate the log-linear model by OLS.

                          Estimation by PPML can be performed using the -ppml- command (you can install it form SSC), keeping in mind that the dependent variable should be trade rather than log of trade (the regressors are exactly the same).

                          Best of luck,

                          Joao

                          Comment


                          • #14
                            Thank you very much for your help!
                            You are the best

                            Comment


                            • #15
                              Dear Professor Santos Silva,
                              How are the commands to regress this panel data in random effect gravity model?
                              How are the steps to finally use xtmixed command for random efect?
                              the dependent variable is ln export, the independent variable are ln GDPexpimp, IDBF, ln Distance, and Contigency.
                              Thanks before! :D
                              Attached Files

                              Comment

                              Working...
                              X