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.