Tetrads
estimates gravity models
by taking the ratio of the ratio of flows.
Tetrads(y, dist, x, k = "USA", ell = "JPN", multiway_vcov = TRUE, data,
...)
name (type: character) of the dependent variable in the dataset
data
, e.g. trade flows. It is logged and
taken as the dependent variable in the estimation.
name (type: character) of the distance variable in the dataset
data
containing a measure of distance between all pairs of bilateral
partners. It is logged automatically when the function is executed.
vector of names (type: character) of those bilateral variables in
the dataset data
that should be taken as the independent variables
in the estimation. If an independent variable is a dummy variable,
it should be of type numeric (0/1) in the dataset. If an independent variable
is defined as a ratio, it should be logged.
Unilateral effects drop as the ratio of ratios is taken.
reference importing country, default is set to "USA"
.
reference exporting country, default is set to "JPN"
.
(type: logic) optional; determines whether a function
implementing Cameron, Gelbach, & Miller (2011) multi-way clustering of
variance-covariance matrices in the package multiway_vcov
is used
for the estimation. In case multiway_vcov=TRUE
, the
cluster.vcov
function is used. The default value is set to TRUE
.
name of the dataset to be used (type: character).
To estimate gravity equations, a square gravity dataset including bilateral
flows defined by the argument y
, ISO-codes of type character
(called iso_o
for the country of origin and iso_d
for the
destination country), a distance measure defined by the argument dist
and other potential influences given as a vector in x
are required.
All dummy variables should be of type numeric (0/1). Missing trade flows as
well as incomplete rows should be excluded from the dataset.
Furthermore, flows equal to zero should be excluded as the gravity equation
is estimated in its additive form.
When using panel data, a variable for the time may be included in the
dataset. Note that the variable for the time dimension should be of
type: factor. See the references for more information on panel data.
additional arguments to be passed to functions used by
Tetrads
.
The function returns the summary of the estimated gravity model as an
lm
-object.
Tetrads
is an estimation method for gravity models
developed by Head et al. (2010) (see the references for
more information).
To execute the function a square gravity dataset with all pairs of
countries, ISO-codes for the country of origin and destination, a measure of
distance between the bilateral partners as well as all
information that should be considered as dependent an independent
variables is needed.
Make sure the ISO-codes are of type "character".
Missing bilateral flows as well as incomplete rows should be
excluded from the dataset.
Furthermore, flows equal to zero should be excluded as the gravity equation
is estimated in its additive form.
The function Tetrads
utilizes the multiplicative form of the
gravity equation. After choosing a reference importer k
and
exporter ell
one can eliminate importer and exporter fixed effects
by taking the ratio of ratios. Only those exporters trading with the
reference importer and importers trading with the reference exporter will
remain for the estimation. Therefore, reference countries should
preferably be countries which trade with every other country in the dataset.
After restircting the data in this way, Tetrads
estimates the gravity
equation in its additive form by OLS.
As, by taking the ratio of ratios, all monadic effects diminish, no
unilateral variables such as GDP can be included as independent variables.
Tetrads
estimation can be used for both, cross-sectional as well as
panel data. Nonetheless, the function is designed to be consistent with the
Stata code for cross-sectional data provided on the website
Gravity Equations: Workhorse, Toolkit, and Cookbook
when choosing robust estimation.
The function Tetrads
was therefore tested for cross-sectional data.
If Tetrads is used for panel data, the user may has to drop distance as an
independent variable as time-invariant effects drop.
For applying Tetrads
to panel data see Head, Mayer and Ries (2010).
For information on Tetrads
see
Cameron, A. C., Gelbach, J. B., and Miller, D. L. (2011) <DOI:10.3386/t0327>
Head, K., Mayer, T., & Ries, J. (2010) <DOI:10.1016/j.jinteco.2010.01.002>
For more information on gravity models, theoretical foundations and estimation methods in general see
Anderson, J. E. (1979) <DOI:10.12691/wjssh-2-2-5>
Anderson, J. E. (2010) <DOI:10.3386/w16576>
Anderson, J. E. and van Wincoop, E. (2003) <DOI:10.3386/w8079>
Baier, S. L. and Bergstrand, J. H. (2009) <DOI:10.1016/j.jinteco.2008.10.004>
Baier, S. L. and Bergstrand, J. H. (2010) in Van Bergeijk, P. A., & Brakman, S. (Eds.) (2010) chapter 4 <DOI:10.1111/j.1467-9396.2011.01000.x>
Head, K. and Mayer, T. (2014) <DOI:10.1016/B978-0-444-54314-1.00003-3>
Santos-Silva, J. M. C. and Tenreyro, S. (2006) <DOI:10.1162/rest.88.4.641>
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
Egger, P., & Pfaffermayr, M. (2003) <DOI:10.1007/s001810200146>
Gomez-Herrera, E. (2013) <DOI:10.1007/s00181-012-0576-2>
and the references therein.
# NOT RUN {
data(Gravity)
Tetrads(y="flow", dist="distw", x=c("rta"), k="USA", ell="JPN",
multiway_vcov=TRUE, data=Gravity)
Tetrads(y="flow", dist="distw", x=c("rta", "comcur", "contig"),
k="USA", ell="JPN", multiway_vcov=FALSE, data=Gravity)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab