mte_tilde_at {localIV}R Documentation

Evaluate Marginal Treatment Effects Projected onto the Propensity Score

Description

mte_tilde_at evaluates marginal treatment effects projected onto the estimated propensity score. The projection is done via the function gam.

Usage

mte_tilde_at(p, u, model, ...)

Arguments

p

A numeric vector. Values of the propensity score at which \widetilde{\textup{MTE}}(p, u) is evaluated.

u

A numeric vector. Values of the latent resistance at which \widetilde{\textup{MTE}}(p, u) is evaluated.

model

A fitted MTE model returned by mte.

...

Additional parameters passed to gam.

Value

mte_tilde_at returns a list of two elements:

df

A data frame containing five columns:

  • p input values of p.

  • u input values of u.

  • p_comp the p-component of the estimated \widetilde{\textup{MTE}}(p, u)

  • u_comp the u-component of the estimated \widetilde{\textup{MTE}}(p, u)

  • value estimated values of \widetilde{\textup{MTE}}(p, u)

proj

Fitted gam 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, 127(6): 3070-3084.

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

Examples

mod <- mte(selection = d ~ x + z, outcome = y ~ x, data = toydata)

u <- p <- seq(0.05, 0.95, 0.1)
mte_tilde <- mte_tilde_at(p, u, model = mod)

# heatmap showing MTE_tilde(p, u)
if(require("ggplot2")){
ggplot(mte_tilde$df, aes(x = u, y = p, fill = value)) +
  geom_tile() +
  scale_fill_gradient(name = expression(widetilde(MTE)(p, u)), low = "yellow", high = "blue") +
  xlab("Latent Resistance U") +
  ylab("Propensity Score p(Z)") +
  theme_minimal(base_size = 14)
}

mprte_tilde_df <- subset(mte_tilde$df, p == u)

# heatmap showing MPRTE_tilde(p)
if(require("ggplot2")){
ggplot(mprte_tilde_df, aes(x = u, y = p, fill = value)) +
  geom_tile() +
  scale_fill_gradient(name = expression(widetilde(MPRTE)(p)), low = "yellow", high = "blue") +
  xlab("Latent Resistance U") +
  ylab("Propensity Score p(Z)") +
  theme_minimal(base_size = 14)
}

# MPRTE_tilde(p) decomposed into the p-component and the u-component
if(require(tidyr) && require(dplyr) && require(ggplot2)){
mprte_tilde_df %>%
  pivot_longer(cols = c(u_comp, p_comp, value)) %>%
  mutate(name = recode_factor(name,
         `value` = "MPRTE(p)",
         `p_comp` = "p(Z) component",
         `u_comp` = "U component")) %>%
  ggplot(aes(x = p, y = value)) +
  geom_line(aes(linetype = name), size = 1) +
  scale_linetype(name = "") +
  xlab("Propensity Score p(Z)") +
  ylab("Treatment Effect") +
  theme_minimal(base_size = 14) +
  theme(legend.position = "bottom")
}


[Package localIV version 0.3.1 Index]