bvw: Bonus vetus OLS (BVW)

View source: R/bvw.R

bvwR Documentation

Bonus vetus OLS (BVW)

Description

bvw estimates gravity models via Bonus vetus OLS with income-weights.

Usage

bvw(
  dependent_variable,
  distance,
  additional_regressors = NULL,
  income_origin,
  income_destination,
  code_origin,
  code_destination,
  robust = FALSE,
  data,
  ...
)

Arguments

dependent_variable

(Type: character) name of the dependent variable. This dependent variable is divided by the product of unilateral incomes such (i.e. income_origin and income_destination) and logged afterwards.

distance

(Type: character) name of the distance variable that should be taken as the key independent variable in the estimation. The distance is logged automatically when the function is executed.

additional_regressors

(Type: character) names of the additional regressors to include in the model (e.g. a dummy variable to indicate contiguity). Unilateral metric variables such as GDP should be inserted via the arguments income_origin and income_destination. As country specific effects are subdued due to demeaning, no further unilateral variables apart from incomes can be added.

Write this argument as c(contiguity, common currency, ...). By default this is set to NULL.

income_origin

(Type: character) origin income variable (e.g. GDP) in the dataset.

income_destination

(Type: character) destination income variable (e.g. GDP) in the dataset.

code_origin

(Type: character) country of origin variable (e.g. ISO-3 country codes). The variables are grouped using this parameter.

code_destination

(Type: character) country of destination variable (e.g. country ISO-3 codes). The variables are grouped using this parameter.

robust

(Type: logical) whether robust fitting should be used. By default this is set to FALSE.

data

(Type: data.frame) the dataset to be used.

...

Additional arguments to be passed to the function.

Details

Bonus vetus OLS is an estimation method for gravity models developed by \insertCiteBaier2009,Baier2010;textualgravity using income-weights to center a Taylor series.

The bvw function considers Multilateral Resistance terms and allows to conduct comparative statics. Country specific effects are subdued due to demeaning. Hence, unilateral variables apart from inc_o and inc_d cannot be included in the estimation.

bvw is designed to be consistent with the Stata code provided at Gravity Equations: Workhorse, Toolkit, and Cookbook when choosing robust estimation.

As, to our knowledge at the moment, there is no explicit literature covering the estimation of a gravity equation by bvw using panel data, we do not recommend to apply this method in this case.

Value

The function returns the summary of the estimated gravity model as an lm-object.

References

For more information on gravity models, theoretical foundations and estimation methods in general see

\insertRef

Anderson1979gravity

\insertRef

Anderson2001gravity

\insertRef

Anderson2010gravity

\insertRef

Baier2009gravity

\insertRef

Baier2010gravity

\insertRef

Feenstra2002gravity

\insertRef

Head2010gravity

\insertRef

Head2014gravity

\insertRef

Santos2006gravity

and the citations therein.

See Gravity Equations: Workhorse, Toolkit, and Cookbook for gravity datasets and Stata code for estimating gravity models.

For estimating gravity equations using panel data see

\insertRef

Egger2003gravity

\insertRef

Gomez-Herrera2013gravity

and the references therein.

See Also

lm, coeftest, vcovHC

Examples

# Example for CRAN checks:
# Executable in < 5 sec
library(dplyr)
data("gravity_no_zeros")

# Choose 5 countries for testing
countries_chosen <- c("AUS", "CHN", "GBR", "BRA", "CAN")
grav_small <- filter(gravity_no_zeros, iso_o %in% countries_chosen)

fit <- bvw(
  dependent_variable = "flow",
  distance = "distw",
  additional_regressors = c("rta", "comcur", "contig"),
  income_origin = "gdp_o",
  income_destination = "gdp_d",
  code_origin = "iso_o",
  code_destination = "iso_d",
  robust = FALSE,
  data = grav_small
)

gravity documentation built on May 2, 2023, 9:13 a.m.