mte
is a function that estimates MTE using either semiparametric local
instrumental variables (local IV) or a normal selection model (Heckman, Urzua, Vytlacil 2006).
The user supplies a formula for the treatment selection model, a formula for the
outcome model, and a data frame containing the variables. The function returns an
object of class mte
. Observations which contain NA (either in selection
or
outcome
) are removed.
mte(selection, outcome, data, method = c("localIV", "normal"),
bw = 0.25)
A formula representing the selection equation.
A formula representing the outcome equation where the left hand side is the observed outcome and the right hand side includes predictors of both potential outcomes.
An optional data frame, list, or environment containing the variables in the model.
How to estimate the model: either "localIV
" for semiparametric local IV
or "normal
" for a normal selection model.
Bandwidth used for the local polynomial regression in the local IV approach. Default is 0.25.
An object of class mte
.
A list of fitted coefficients: gamma
for the treatment selection model
(a probit model), beta1
for the baseline outcome, beta2
for the treated outcome,
and theta1
and theta2
for the error covariances when method = "normal"
.
Estimated propensity scores.
The propensity score model, an object of class glm
if method = "localIV"
, or an object of class selection
if method = "normal"
.
The model matrix for the treatment selection equation.
The response vector for the treatment selection equation.
The model matrix for the outcome equation.
The observed outcome.
The matched call.
Heckman, James J., Sergio Urzua, and Edward Vytlacil. 2006. "Understanding Instrumental Variables in Models with Essential Heterogeneity." The Review of Economics and Statistics 88:389-432.
# NOT RUN {
mte_fit <- mte(selection = d ~ x + z, outcome = y ~ x, data = toydata, bw = 0.25)
summary(mte_fit$ps_model)
hist(mte_fit$ps)
# }
Run the code above in your browser using DataLab