Announcement

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

  • Methods of Estimation in Gravity Model

    Hello,

    I'd like to develop a Gravity Model, but I'm not sure which method to use. I have seen various methods such as OLS, Fixed and Random Effects Estimation, and PPML (or the command PPMLHDFE). However, I already have the data and a general idea. First, I want to create a gravity model for an origin country and a number of countries or trade bloc members as destination countries. I plan to use trade flow (exports plus imports) as the dependent variable and include numerous independent variables such as GDP (or the product of GDPs), Remoteness (or another variable that changes over time and measures distance), Population, Exchange Rate, Inflation Rate, Tariffs, Capital Stock, FDI, Employment, Sanitary Measures, and so on. I want to consider as many variables as possible. I also plan to create variables such as the absolute value of the difference of capital stock or some ratios.

    Additionally, I’d like to compare the resultant gravity model of trade blocs with a bilateral gravity model that considers only the origin country and one destination country from that trade bloc. In this context, I’ve seen that each model produces different results depending on the number of countries considered. Moreover, when there are just two countries, it's not possible to include variables that don’t change over time, such as Distance or Language.

    In summary, I’m uncertain about which method to use for making these comparisons and incorporating so many independent variables. I hope you can help me. Thank you.
    Last edited by Omar Perez; 30 May 2024, 21:04.

  • #2
    Dear Omar Perez,

    You should read this before proceeding.

    Best wishes,

    Joao

    Comment


    • #3
      Dear Joao Santos Silva,

      Thank you very much for your advice. I truly appreciate it. I have already read the guide; however, I still have some questions:

      1) Is the dependent variable the sum of exports and imports of country i to country j as one observation, or is it only the exports of country i to j and then another observation for the exports of country j to i? I just want to be sure.

      2) I've encountered problems when creating the model for only two countries since it was not possible to have fixed effects, so I ran a PPML model without clustering and another using bootstrap. Is that correct, or should a model not be made with only two countries? I didn´t find literature about that.

      3) I've read that multicollinearity might not be important in gravity models. Where could I read more about that? I've also read that a possible approach is to run the model using OLS first and check for multicollinearity before proceeding.

      I hope you can help me with that as well, and I thank you very much in advance.

      Comment


      • #4
        Dear Omar Perez,

        1) Not the sum, just the exports.
        2) It all depends on what you want to do. The results of a model estimated with just two countries is difficult to generalize to other countries, but may be what you want to do if you are just interested in the trade between those countries. In any case, if you just have data for two countries the sample will be very small and the results will not be very reliable.
        3) Multicollinearity is never very important, but it is not different in gravity equations. For more on the topic, please check chapter 23 of this book.

        Best wishes,

        Joao

        Comment


        • #5
          Dear Joao Santos Silva,

          Thank you very much again for your response.

          Regarding my second question, I am now considering a group of countries: a main country and five additional countries. My model is focused on evaluating the effectiveness of Free Trade Agreements of the main country with countries from Asia region. Following the guide, I am still unable to apply exporter and importer fixed effects because the number of fixed effect variables exceeds the number of observations. Consequently, I tried using only year fixed effects with ppmlhdfe and absorb(year), but Distance was no longer significant. Another possibility I considered was to add more countries, although my preference is to focus on that specific region. What should I do? I seek that the model meets all rigorous standards despite its limitations.

          I hope this will be my final request as I do not want to trouble you further. If you have any information about fixed effects to control for multilateral resistance in that cases, I would greatly appreciate it.

          Kind regards,

          Omar
          Last edited by Omar Perez; 11 Jun 2024, 21:44.

          Comment


          • #6
            Dear Omar Perez,

            With just 6 countries your options are very limited, so I suggest you think about the problem and decide on the best specification for tour problem. Anyway, you should at least be able to include pair fixed effects, right?

            Best wishes,

            Joao

            Comment


            • #7
              Dear Joao Santos Silva,

              Thank you again for your reply. Indeed, the inclusion of pair fixed effects works very well in that case. However, I also encountered an issue when trying to apply exporter and importer fixed effects while analyzing trade flows between a main country and the rest of the world.

              Following the guide, I used this code first:

              egen exp_time = group(exporter year)
              tabulate exp_time, generate(EXPORTER_TIME_FE)
              egen imp_time = group(importer year)
              tabulate imp_time, generate(IMPORTER_TIME_FE)


              But I got the error "too many values" because of tabulate. So I tried using this code instead:

              ppmlhdfe trade ln_dist, absorb(exp_time imp_time) cluster(pair_id)

              Then I got the error "insufficient observations". I expected to have enough observations analyzing the trade flows between a main country and the rest of the world. Am I doing something wrong in this specific case? I have followed the entire structure of the guide up to the fixed effects point.

              Additionally, I could run the codes without problems when analyzing trade between all countries, so I'm unsure to what extent selecting a main country affects the use of exporter and importer fixed effects. In the worst-case scenario, should I reconsider using exporter and importer fixed effects, or is there an alternative approach I should take? The purpose of the investigation is to analyze trade flows between a main country and other selected countries.

              I hope you can provide some advice.

              Kind regards,

              Omar

              Comment


              • #8
                Dear Omar Perez

                I think you are not using ppmlhdfe correctly. For example, to include exporter-year FEs you can just absorb exporter#year. Please check the help file for details.

                Best wishes,

                Joao

                Comment


                • #9
                  Dear Joao Santos Silva,

                  Thank you very much for your suggestion. I have already read the help file and the paper as well, so I used the same code:

                  cap egen imp=group(isoimp)
                  cap egen exp=group(isoexp)
                  ppmlhdfe trade ln_dist, absorb(imp#year exp#year imp#exp) cluster(imp#exp) nolog


                  Unfortunately, it didn't work. To be precise, I have 11,210 observations for the period from 1948 to 2021. As I mentioned before, the dataset includes export data from a main country to the rest of the world and from the rest of the world to the main country, resulting in 252 pairs (the data accounts for territorial changes in countries, recording them as separate entities). However, I still received the "insufficient observations" error.

                  I suspect the issue might be due to the number of clusters. If this is the case, should I run the model without clustering, or is there another method to do the same or to handle multilateral resistance terms with fixed effects? I was considering using only pair fixed effects or at least year fixed effects. Another solution I thought of was using remoteness indexes.

                  From checking the forum, I understand that this could be a common issue when analyzing trade flows for a single main country or when the dataset includes a smaller number of countries, as in my initial attempt.

                  I would greatly appreciate your assistance, and my apologies for any inconvenience.

                  Kind regards,

                  Omar

                  Comment


                  • #10
                    Dear Joao Santos Silva Tom Zylkin Should we be concerned with the following message in STATA results while executing PPMLHDFE command?
                    warning: dependent variable takes very low values after standardizing (1.2490e-10).

                    Despite this warning, stata provides the estimation results as usual. Thank you.

                    Comment


                    • #11
                      Dear sabeer vc,

                      I see that all the time and never worry about it :-)

                      Best wishes,

                      Joao

                      Comment


                      • #12
                        Ok. That is a point for relief. Thank you.

                        Comment

                        Working...
                        X