Learn R Programming

localIV (version 0.3.1)

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

Description

mte_at evaluates marginal treatment effects at different values of the latent resistance u with a given \(X=x\).

Usage

mte_at(x = NULL, u, model)

Arguments

x

Values of the pretreatment covariates at which \(\textup{MTE}(x, u)\) is evaluated. It should be a numeric vector whose length is one less than the number of columns of the design matrix \(X\) in the outcome model. Default is the sample means.

u

A numeric vector. Values of the latent resistance \(u\) at which \(\textup{MTE}(x, u)\) is evaluated. Note that the estimation involves extrapolation when the specified u values lie outside of the support of the propensity score.

model

A fitted MTE model returned by mte.

Value

mte_at returns a data frame.

u

input values of u.

x_comp

the x-component of the estimated \(\textup{MTE}(x, u)\)

u_comp

the u-component of the estimated \(\textup{MTE}(x, u)\)

value

estimated values of \(\textup{MTE}(x, u)\)

Examples

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

mte_vals <- mte_at(u = seq(0.05, 0.95, 0.1), model = mod)
if(require("ggplot2")){
  ggplot(mte_vals, aes(x = u, y = value)) +
  geom_line(size = 1) +
  xlab("Latent Resistance U") +
  ylab("Estimates of MTE at Mean Values of X") +
  theme_minimal(base_size = 14)
}

# }

Run the code above in your browser using DataLab