Announcement

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

  • Gravity equation estimated through Bonus Vetus OLS

    Dear Stata users,

    Following Agostino and Trivieri (2014), I would like to adopt the Bonus Vetus OLS for a gravity equation (Baier and Bergstrand, 2009).
    My problem is that I do not know how to code in Stata to apply a first-order Taylor expansion to the multilateral resistance terms of the Anderson and van Wincoop (2003) model, as follows:

    MRX_ij = Σ[(GDP_k / GDP_w) * X_ik] + Σ[(GDP_m / GDP_w) * X_mj] - ΣΣ[(GDP_k / GDP_w) * (GDP_m / GDP_w) * X_km]

    Where i is an exporter and j an importer; X_ij are observed proxies of bilateral trade costs (e.g.: distance, common language, common currency); indexes k and m represent countries partners of i and j, respectively; X_ij=X_ji, in the sense that, for example, the distance between i and j is the same distance between j and i; GDP_w represents World GDP.

    Additionally, the data goes annually from 2006 to 2016, which makes me believe that the above equation requires an index t, because, despite X_ik being time-invariant, GDP will be time-variant.

    My sample consider exporting data from 1 exporter to 40 importers, however I have data about X_ij for all country pairs ij.
    Here is my first question: can I apply such methodology having trade data for only one exporter? Or I only need data for GDP and X variables? For example, Agostino and Trivieri (2014) has 3 exporters and 211 importing countries.

    Then the second question is: if it is possible to follow this methodology, can someone help me with the Stata code?

    Referred literature:
    Agostino, M., Trivieri, F., 2014. Geographical indication and wine exports. An empirical investigation considering the major European producers. Food Policy, 46, 22-36.
    Anderson, J.E., van Wincoop, E., 2003. Gravity with gravitas: a solution to the border puzzle. Am. Econ. Rev. 93 (1), 170–192.
    Baier, S.L., Bergstrand, J.H., 2009. Bonus vetus OLS: a simple method for approximating international trade-cost effects using the gravity equation. J. Int. Econ. 77, 77–85.

  • #2
    Hi Anthony,
    I think Keith Head and Thierry Mayer have some code for this on their gravity webpage.
    Regards,
    Tom

    Comment


    • #3
      Thank you for your advice Tom.

      In fact they have some code available to estimate Bonus Vetus OLS for a Monte Carlo but they use an ado file called BVU.ado (or BVW.ado for the GDP-weighted version) also available in the website. It is not a Stata command as, for example, regress or ppml, where we have options, an help file, etc.

      Following their DO file, I can make the following regression to estimate the coefficient for ldis and fta_wto, using lXrealnorm as a dependent variable:
      Code:
       BVU Y_i Y_n iso_o iso_d ldis fta_wto lXreal lYi lYn lXrealnorm Xr cnum_i cnum_n
      However, I am not able to include more variables. For example, if I use the following code to add the regressor comcur:
      Code:
       BVU Y_i Y_n iso_o iso_d ldis fta_wto comcur lXreal lYi lYn lXrealnorm Xr cnum_i cnum_n
      It will assume that the dependent variable is the 10th variable (lYn) again instead of lXrealnorm, and will consider only ldis and fta_wto as regressors.

      I was not able to find a Stata program to do a Bonus Vetus OLS estimation as, for example, in the R package “gravity”.

      Best regards,
      Anthony

      Comment


      • #4
        Hi Anthony,
        You're right that Head and Mayer's code is only set up to do the particular Monte Carlo they do. I did not realize that. It looks like it will need to be modified so that it can handle more than just two regressors (likely by adding a for loop).

        If you're interested in coding it yourself you will need to change lines 4-17 to something like

        Code:
        syntax varlist [if] [in], iso_o(varname) iso_d(varname)
        
        tokenize `varlist'    
        local lXinnorm `1'
        macro shift
        local RHSvars `*'
        unab RHSvars: `*'
        Then if you input the following in Stata

        Code:
        BVU lXrealnorm ldis fta_wto comcur, iso_o(iso_o) iso_d(iso_d)
        The command will always take the first variable name to be "lXinnorm" and will also record "iso_o" and "iso_d" consistently with how they currently have it set up

        But after that you would have to re-write their code so that it loops across the different variable names in RHSvars and de-means them consistently with what they have done. You will have to study their code and modify it appropriately though. Hope this is at least a little bit helpful.

        Regards,
        Tom

        Comment


        • #5
          Thank you Tom for your help.
          I am not very good at coding, so I think that modifying their code may lead me to some mistakes.
          I prefer trying R package “gravity”.
          Best regards,
          Anthony

          Comment


          • #6
            I have trade data on imports in 115 countries across 21 industries in my sample . I am using Baier and Bergstrand (2009) approach of modelling Multilateral resistance using taylor series approximation . I am expressing bilateral resistance (t_ij) as a function of observables in my data (e.g; distance, openness, tarrifs, population, human capital, contiguity, common language, common colony) . However i have difficulty in generating Multilateral resistance terms for each of my observables. I am using simple average weights ( theata_i = theata_j = 1/N). I have tried using following codes to generate mulilateral resistance expression for my distance variable (say), which i denote by MRDIST :
            egen temp1 = mean(distw), by (exporter industry)
            egen temp2 = mean(distw), by (importer industry)
            egen temp3 = mean(distw), by (industry)
            gen MRDIST = distw - temp1 - temp2 - (1/N2) * temp3

            Similarily if i had to generate Multilateral expression for openness, which i refer MROPENNESS, i am running the following codes
            egen temp1 = mean(openness), by (exporter industry)
            egen temp2 = mean(openness), by (importer industry)
            egen temp3 = mean(openness), by (industry)
            gen MROPENNESS = openness - temp1 - temp2 - (1/N2) * temp3

            The variable distance (distw) is dyadic is as it gives distance between country pairs (importer-exporter).
            The variable openness is related to only importer countries openness calculated as (exports + imports) divided by GDP.
            Please guide me whether i am doing it right or not ? if there is any other way, please suggest .
            finally i am running a regression
            ppml ln_tradevalues MRDIST MROPENNESS and other covariates, robust cluster (distw)

            Comment


            • #7
              Hi Ridwan,
              Sorry this is not something I have experience and I don't want to lead you astray. Have you checked your code against the code on Head and Mayer's webpage? One piece of advice would be start by seeing if you can replicate their results.

              The other thing to mention is that ppml should be used with the original trade value (in levels) rather than the log. Remember that it assumes an exponential mean: y = exp(xb) + e.

              Regards,
              Tom

              Comment


              • #8
                Thanks Tom !
                I haven't checked Head and Mayer's web page as of now , I will once check it and see whether I can replicate the codes in my case . Thanks for the suggestion.
                Best regards,
                (Ridwan)

                Comment

                Working...
                X