Learn R Programming

⚠️There's a newer version (1.1) of this package.Take me there.

gravity (version 0.5)

A Compilation of Different Estimation Methods for Gravity Models

Description

Gravity models are used to explain bilateral flows related to the sizes of bilateral partners, a measure of distance between them and other influences on interaction costs. The underlying idea is rather simple. The greater the masses of two bodies and the smaller the distance between them, the stronger their attraction. This concept is applied to several research topics such as trade, migration or foreign direct investment. Even though their basic idea is rather simple, gravity models can become complex regarding the choice of models or estimation methods. As especially for gravity beginners it is difficult to get an overview of the different methods and implement them in R, the package provides a wrapper of different standard estimation methods for gravity models. By considering the descriptions and codes of the estimation methods, users get a comprehensive and application-oriented overview of the different methods, see which method may be suitable for a certain research question or type of data and extend the code available to their research projects. The package contains two types of estimation methods: those estimating gravity models in their log-log form, such as Ordinary Least Squares (OLS), Fixed Effects, Double Demeaning (DDM), Bonus vetus OLS with simple averages (BVU) and with GDP-weights (BVW), Structural Iterated Least Squares (SILS) and Tetrads. These methods are partly complex to understand and program and thus a comparison of them is not straightforward, wherefore the package aims at easing an overview of the different methods combined with a direct application. A second type of estimation methods utilizes the gravity model in its multiplicative form with a log-link and different families of distributions. They are relatively easy to compute and added for completeness and contain the methods Poisson Pseudo Maximum Likelihood (PPML), Gamma Pseudo Maximum Likelihood (GPML), Negative Binomial Pseudo Maximum Likelihood (NBPML), and Nonlinear Least Squares (NLS). The functions all estimate gravity models, but they differ in whether they estimate them in their multiplicative or additive form, their requirements with respect to data, their handling of Multilateral Resistance terms as well as their possibilities concerning the inclusion of unilateral independent variables. Therefore, they normally lead to different estimation results. We refer the user to the Gravity Cookbook website () for more information on gravity models in general. Head, K. and Mayer, T. (2014) provide a comprehensive and accessible overview of the theoretical and empirical development of the gravity literature as well as the use of gravity models and the various estimation methods, especially their merits and potential problems regarding applicability as well as different gravity datasets. In order to have a straightforward application of all methods, the package comes with an example dataset and examples utilizing this dataset are included in the descriptions of the methods. As the range of gravity models and their suitable estimation methods is huge and specific to data and research question at hand, the functions are kept simple such that researchers can utilize them as a starting point of their research and get familiar with them. On the Gravity Cookbook website () Keith Head and Thierry Mayer provide Stata code for most methods. Where possible, the functions are tested to lead the same results as the Stata code when choosing the option of robust variance estimation. However, compared to the Stata code available, the functions presented in this package provide users with more flexibility regarding the type of estimation (robust or not robust), the number and type of independent variables as well as the possible data. Furthermore, additional functions are added. The functions of the package include distance as an independent variable. If a panel model is used time-invariant effects, such as geographical distance, may have to be excluded, see the respective descriptions. Therefore, it is up to the user to ensure that the functions can be applied to panel data. Depending on the panel dataset and the variables - specifically the type of fixed effects - included in the model, it may easily occur that the model is not computable. Depending on the specific model, the code of the respective function may has to be changed in order to exclude the distance variable from the estimation. For a comprehensive overview of gravity models for panel data see Egger, P., & Pfaffermayr, M. (2003) , Gomez-Herrera, E. (2013) and Head, K., Mayer, T., & Ries, J. (2010) as well as the references therein (see also the references included in the descriptions of the different functions). At the very least, the user should take special care with respect to the meaning of the estimated coefficients and variances as well as the decision about which effects to include in the estimation. As, to our knowledge at the moment, there is no explicit literature covering the estimation of a gravity equation by Double Demeaning, Structural Iterated Least Squares or Bonus vetus OLS using panel data, we do not recommend to apply these methods in this case. Contributions, extensions and error corrections are very welcome. Please do not hesitate to contact us.

Copy Link

Version

Install

install.packages('gravity')

Monthly Downloads

528

Version

0.5

License

GPL-2

Maintainer

Anna-Lena Woelwer

Last Published

November 14th, 2017

Functions in gravity (0.5)

OLS

OLS
BVW

Bonus vetus OLS, BVW
DDM

Double Demeaning, DDM
Fixed_Effects

Fixed_Effects
PPML

Poisson Pseudo Maximum Likelihood, PPML
BVU

Bonus vetus OLS, BVU
NBPML

Negative Binomial Pseudo Maximum Likelihood, NBPML
NLS

Nonlinear Least Squares, NLS
SILS

Structural Iterated Least Squares, SILS
Tetrads

Tetrads
GPML

Gamma Pseudo Maximum Likelihood, GPML
Gravity

Gravity dataset