Learn R Programming

localIV (version 0.2.1)

mte: Estimation of Marginal Treatment Effects (MTE)

Description

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.

Usage

mte(selection, outcome, data, method = c("localIV", "normal"),
  bw = 0.25)

Arguments

selection

A formula representing the selection equation.

outcome

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.

data

An optional data frame, list, or environment containing the variables in the model.

method

How to estimate the model: either "localIV" for semiparametric local IV or "normal" for a normal selection model.

bw

Bandwidth used for the local polynomial regression in the local IV approach. Default is 0.25.

Value

An object of class mte.

coefs

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".

ps

Estimated propensity scores.

ps_model

The propensity score model, an object of class glm if method = "localIV", or an object of class selection if method = "normal".

Z

The model matrix for the treatment selection equation.

D

The response vector for the treatment selection equation.

X

The model matrix for the outcome equation.

Y

The observed outcome.

call

The matched call.

References

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.

See Also

eval_mte for evaluating MTE at any combination of covariates x and latent resistance u; eval_mte_tilde for evaluating MTE projected onto the propensity score; average for estimating conventional parameters such as ATE and ATT; mprte for estimating marginal policy relevant treatment effects (MPRTE).

Examples

Run this code
# 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)

# plot MTE(x, u) as a function of u
u <- seq(0.005, 0.995, 0.01)
out <- eval_mte(mte_fit, u = u)
plot(out$mte ~ u, type = "l", lwd = 2)

# }

Run the code above in your browser using DataLab