bvw
estimates gravity models via Bonus
vetus OLS with GDP-weights.
bvw(dependent_variable, regressors, incomes, codes, robust = TRUE, data, ...)
name (type: character) of the dependent variable in the dataset
data
(e.g. trade flows).
This dependent variable is divided by the
product of unilateral incomes (e.g.
GDPs or GNPs of the countries of interest, named inc_o
and inc_d
in the example datasets)
and logged afterwards.
The transformed variable is then used as the dependent variable in the estimation.
name (type: character) of the regressors to include in the model.
Include the distance variable in the dataset data
containing a measure of
distance between all pairs of bilateral partners and bilateral variables that should
be taken as the independent variables in the estimation.
The distance is logged automatically when the function is executed.
Unilateral metric variables such as GDPs should be inserted via the argument incomes
.
As country specific effects are subdued due to demeaning, no further unilateral variables apart from unilateral incomes can be added.
Write this argument as c(distance, contiguity, common curreny, ...)
.
variable name (type: character) of the income of the country of
origin (e.g. inc_o
) and destination (e.g. inc_d
) in the dataset data
.
The dependent variable dependent_variable
is divided by the product of the incomes.
Write this argument as c(income origin, income destination)
.
variable name (type: character) of the code of the country
of origin and destination (e.g. ISO-3 codes from the variables iso_o
and iso_d
) in the
example datasets).
The variables are grouped by using iso_o
and iso_d
to obtain estimates.
Write this argument as c(code origin, code destination)
.
robust (type: logical) determines whether a robust
variance-covariance matrix should be used. By default is set to TRUE
.
If robust = TRUE
the estimation results are consistent with the
Stata code provided at Gravity Equations: Workhorse, Toolkit, and Cookbook
when choosing robust estimation.
name of the dataset to be used (type: character).
To estimate gravity equations you need a square dataset including bilateral
flows defined by the argument dependent_variable
, ISO codes or similar of type character
(e.g. iso_o
for the country of origin and iso_d
for the
destination country), a distance measure defined by the argument distance
and other potential influences (e.g. contiguity and common currency) given as a vector in
regressors
are required.
All dummy variables should be of type numeric (0/1).
Make sure the ISO codes are of type "character".
If an independent variable is defined as a ratio, it should be logged.
The user should perform some data cleaning beforehand to remove observations that contain entries that can distort estimates.
The function will remove zero flows and distances.
additional arguments to be passed to bvw
.
The function returns the summary of the estimated gravity model as an
lm
-object.
Bonus vetus OLS is an estimation method for gravity models developed by Baier2009,Baier2010;textualgravity using GDP-weights to center a Taylor-series (see the references for more information).
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.
For estimating gravity equations via Bonus Vetus OLS see
Baier2009gravity
Baier2010gravity
For more information on gravity models, theoretical foundations and estimation methods in general see
Anderson1979gravity
Anderson2001gravity
Anderson2010gravity
Baier2009gravity
Baier2010gravity
Head2010gravity
Head2014gravity
Santos2006gravity
and the citations therein.
See Gravity Equations: Workhorse, Toolkit, and Cookbook for gravity datasets and Stata code for estimating gravity models.
# NOT RUN {
data(gravity_no_zeros)
bvw(dependent_variable = "flow", regressors = c("distw", "rta"),
incomes = c("gdp_o", "gdp_d"), codes = c("iso_o", "iso_d"),
robust = TRUE, data = gravity_no_zeros)
bvw(dependent_variable = "flow", regressors = c("distw", "rta", "comcur", "contig"),
incomes = c("gdp_o", "gdp_d"), codes = c("iso_o", "iso_d"),
robust = TRUE, data = gravity_no_zeros)
# }
# NOT RUN {
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab