tobit
estimates gravity models in their additive form
by conducting a left-censored regression, which, after adding the
constant 1
to the dependent variable, utilizes log(1) = 0
as the censoring value.
tobit(dependent_variable, regressors, added_constant = 1, data, ...)
name (type: character) of the dependent variable in the dataset
data
(e.g. trade flows).
The number 1
is added and the transformed variable is logged and
taken as the dependent variable in the tobit estimation with lower bound
equal to 0
as log(1) = 0
represents the smallest flows
in the transformed variable.
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 can be added but those variables have to be logged first.
Interaction terms can be added.
Write this argument as c(distance, contiguity, common curreny, ...)
.
scalar (type: numeric); represents
the constant to be added to the dependent variable. The default value
is 1
.
The minimum of log(y + added_constant)
is taken as the
left boundary in the Tobit model.
In the often used case of added_constant = 1
, the
dependent variable is left-censored at value 0
as log(1) = 0
.
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 allows zero flows but will remove zero distances.
additional arguments to be passed to tobit
.
The function returns the summary of the estimated gravity model as a
censReg
-object.
tobit
represents the left-censored tobit Tobin1958;textualgravity
approach utilizing a known censoring threshold
which is often used when several gravity models are compared.
When taking the log of the gravity equation flows equal to zero constitute a problem as their log is not defined.
Therefore, in the execution of the function the number 1
is added to all flows and the log(flows+1)
is
taken as the dependent variable.
The tobit estimation is conducted using the censReg
function and setting the lower bound equal to 0
as
log(1)=0
represents the smallest flows in the transformed
variable.
A tobit regression represents a combination of a binary and a linear regression.
This procedure has to be taken into consideration when interpreting the estimated coefficients.
The marginal effects of an explanatory variable on the expected value of the dependent variable equals the product of both the probability of the latent variable exceeding the threshold and the marginal effect of the explanatory variable of the expected value of the latent variable.
The function is designed for cross-sectional data,
but can be easily extended to panel data using the
censReg
function.
A robust estimations is not implemented to the present
as the censReg
function is not
compatible with the vcovHC
function.
For a more elaborate Tobit function, see ek_tobit
for the Eaton and Kortum (2001) Tobit model where each zero trade volume
is assigned a country specific interval with the upper
bound equal to the minimum positive trade level of the respective
importing country.
For more information on gravity models, theoretical foundations and estimation methods in general see
Anderson1979gravity
Anderson2001gravity
Anderson2010gravity
Baier2009gravity
Baier2010gravity
Head2010gravity
Santos2006gravity
and the citations therein.
Especially for Tobit models see
Tobin1958gravity
Eaton1995gravity
Eaton2001gravity
Carson2007gravity
See Gravity Equations: Workhorse, Toolkit, and Cookbook for gravity datasets and Stata code for estimating gravity models.
# NOT RUN {
# Example for data with zero trade flows
data(gravity_zeros)
gravity_zeros <- gravity_zeros %>%
mutate(
lgdp_o = log(gdp_o),
lgdp_d = log(gdp_d)
)
tobit(dependent_variable = "flow", regressors = c("distw", "rta", "lgdp_o", "lgdp_d"),
added_constant = 1, data = gravity_zeros)
# }
# NOT RUN {
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab