Learn R Programming

localIV (version 0.2.1)

eval_mte_tilde: Evaluate Marginal Treatment Effects Projected onto the Propensity Score

Description

eval_mte_tilde is a function that evaluates marginal treatment effects projected onto the estimated propensity score (Zhou and Xie 2019). The projection is done via the function gam with default parameters.

Usage

eval_mte_tilde(object, p, u)

Arguments

object

An object of class mte returned by mte.

p

Value(s) of the propensity score \(p\) at which MTE_tilde(p, u) is evaluated.

u

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

Value

A list of four elements.

mte_tilde

Estimates of MTE_tilde(p, u)

p_comp

Estimates of \(E[\mu_1(X)-\mu_0(X)|P(Z)=p]\)

u_comp

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

model

Fitted model for \(E[\mu_1(X)-\mu_0(X)|P(Z)=p]\)

References

Zhou, Xiang and Yu Xie. 2019. "Marginal Treatment Effects from A Propensity Score Perspective." Journal of Political Economy.

Zhou, Xiang and Yu Xie. 2019. "Heterogeneous Treatment Effects in the Presence of Self-selection: a Propensity Score Perspective." Sociological Methodology.

Examples

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

 # heatmap showing MTE_tilde(p, u)
 p <- rep(seq(0.05, 0.95, 0.1), 10)
 u <- rep(seq(0.05, 0.95, 0.1), each = 10)
 out1 <- eval_mte_tilde(mte_fit, p = p, u = u)
 if(requireNamespace("plotly", quietly = TRUE)){
   plotly::plot_ly(x = u, y = p, z = out1$mte_tilde, type = "heatmap")
 }

 # heatmap showing MPRTE_tilde(p)
 p <- seq(0.05, 0.95, 0.1)
 u <- p
 out2 <- eval_mte_tilde(mte_fit, p = p, u = u)
 if(requireNamespace("plotly", quietly = TRUE)){
   plotly::plot_ly(x = u, y = p, z = out2$mte_tilde, type = "heatmap")
 }

 # decompose MPRTE_tilde(p) into the p-component and the u-component
 y <- with(out2, cbind(mte_tilde, p_comp, u_comp))
 matplot(x = p, y = y, type = "l", lwd = 2)

# }

Run the code above in your browser using DataLab