Announcement

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

  • estimating gravity model of trade

    Hello folks,

    Unlike my previous posts where I had questions regarding executing something in Stata, this one is about an econometric method that I don't have any experience with. Specifically, the gravity model of trade (or migration, or any bilateral movement) is

    HTML Code:
    https://wikimedia.org/api/rest_v1/media/math/render/svg/f5f19608ab4e476adc2b153fc210dca466f46f76
    ,
    where G is a constant, F is trade flow, D is distance and Mi and Mj are country sizes. My understanding is that I can estimate

    HTML Code:
    https://wikimedia.org/api/rest_v1/media/math/render/svg/abd852c0d2c6f3f761cffc634b953903db7147f4
    using OLS, but Santos Silva and Tenreyro (2006) recommend estimating

    HTML Code:
    https://wikimedia.org/api/rest_v1/media/math/render/svg/ec159b4e723e13bde4214f307bea67ec150b7964
    using PPML instead. For the second option, what would depvar and indepvars be in
    Code:
    ppml depvar indepvars [if] [in] [weight] [, options]
    ?
    Follow up question: can I throw in other independent variables, or is it better to collect residuals from PPML and continue my analysis using some other regression?

    Thank you very much,
    Stan
    Last edited by Stan Peterburgsky; 02 Jan 2025, 22:28.

  • #2
    Dear Stan Peterburgsky,

    The dependent variable is the flow you want to model, and the regressors are dummies or the log of strictly positive variables like distance. You can include any regressors you want, so there is no need to use the kind of two-step approach you mention. Anyway, I suggest you read some papers using the method to familiarize yourself with it.

    Best wishes,

    Joao

    Comment


    • #3
      Thank you very much! Honored to get an answer directly from the author!
      Another follow-up question, if I may: I am primarily interested in net flow, with positive and negative values and net explanatory variables such as diff in GDP growth, diff in crime rate, etc. Are there any techniques that deal with net values? Or is my best bet going with the Santos Silva and Tenreyro (2006) methodology (or something similar)? If I do proceed with the Santos Silva and Tenreyro (2006) methodology, is there a problem with double-counting G*Mi*Mj/D and G*Mj*Mi/D?

      Comment


      • #4
        Dear Stan Peterburgsky,

        A gravity equation is not the obvious choice to deal with net flows. Sometimes, gravity equations are used to model the total flow between two partners, but in trade there are good reasons to model only exports; net flows can then be obtained from these.

        Best wishes,

        Joao

        Comment


        • #5
          I am working on estimate the fdi bilateral flow using ppmlhdfe. Here is my code
          qui ppmlhdfe fdi_pos_ijt_new lndist comlang_off comcol fta_wto v2x_corr_jt edgi_jt, a(imp#year exp#year) cluster (imp#exp) d
          predict lambda_2way
          matrix beta_2way = e(b)
          ppml_fe_bias fdi_pos_ijt_new lndist comlang_off comcol fta_wto v2x_corr_jt edgi_jt, i(exp) j(imp) t(year) lambda(lambda_2way) twoway beta(beta_2way)

          However, stata responses:
          The set of x variables (lndist comlang_off comcol fta_wto v2x_corr_jt edgi_jt) does not appear to be of full rank after conditioning on the fixed effects.
          r(111);

          May I know what is the problem in my commands and how to fix this
          Thank you


          Comment


          • #6
            Dear Duy Dang,

            The problem is exactly that: those variables have perfect collinearity with the fixed effects. I do not know what your variables are, but the fact that some of your variables have names that end in jt suggests these are indeed perfectly collinear with the fixed effects you are using. These variables are automattically dropped by ppmlhdfe, but apparently not by ppml_fe_bias. You should exclude from the model all variables dropped by ppmlhdfe and run both commands again.

            Best wishes,

            Joao

            Comment


            • #7
              We are using STATA for creating a model for bilateral trade. We are using gravity dataset of CEPII. While running the model, should we use the entire dataset or include data for only the concerned countries in the bilateral trade?

              Comment


              • #8
                That depends on what you want to do, but generally using all the data is better.

                Comment


                • #9
                  Thanks so much Joao for your reply. We are trying to create the model for India - Lao bilateral trade and finally wish to see the difference between current trade and potential trade.

                  Comment


                  • #10
                    Thanks so much Joao for your reply. We are trying to create the model for India - Lao bilateral trade and finally wish to see the difference between current trade and potential trade. To reach the same, we have used following command: .
                    ppmlhdfe tradeflow_imf_o ln_gdp_o ln_gdp_d ln_pop_o ln_pop_d ln_dist ln_entry_cost fta_wto, absorb(iso3_o iso3_d year)

                    Next, we have used following :
                    predict potential_tradelog, xb

                    . gen potential_trade = exp( potential_tradelog)

                    . gen trade_ratio = tradeflow_imf_o / potential_trade
                    .
                    . gen trade_diff = tradeflow_imf_o - potential_trade

                    And finally find for India, Laos bilateral trade with following command:
                    .
                    . . list iso3_o iso3_d year tradeflow_imf_o potential_trade trade_ratio trade_diff if iso3_o == "IND" & iso3_d == "LAO"

                    Is there any error in the above approach ?

                    Comment


                    • #11
                      I believe the way you are creating the predictions is incorrect: you need the option d in the ppmlhdfe command. Please check the documentation of the command carefully.

                      Also, you may want to see 3-way gravity with pair, importer-year and exporter-year fixed effects.

                      Best wishes,

                      Joao

                      Comment


                      • #12
                        Thanks for the guidance Joao

                        Comment

                        Working...
                        X