Learn R Programming

localIV (version 0.2.1)

eval_mte: Evaluate Marginal Treatment Effects from a Fitted MTE Model.

Description

eval_mte is a function that evaluates marginal treatment effects at any combination of covariates x and latent resistance u from a fitted mte object. Note that the estimation may involve substantial extrapolation when the propensity score has a limited support.

Usage

eval_mte(object, x = colMeans(object$X)[-1], u)

Arguments

object

An object of class mte returned by mte.

x

A set of pretreatment covariates at which MTE(x, u) is evaluated. Default is the sample means.

u

Value(s) of the latent resistance \(u\) at which MTE(x, u) is evaluated.

Value

A list of three elements.

mte

Estimates of MTE(x, u)

x_comp

Estimates of \(\mu_1(x)-\mu_0(x)\)

u_comp

Estimates of \(E[\eta|U=u]\)

Examples

Run this code
# NOT RUN {
mte_fit <- mte(selection = d ~ x + z, outcome = y ~ x,
  method = "localIV", data = toydata)

# 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