Skip to contents

A thin wrapper around the prepost package, which implements the nonparametric bounds of Blackwell, Brown, Hill, Imai, and Yamamoto (2025) for the interaction between a randomized treatment and a binary moderator when the moderator is measured after treatment (post-treatment bias) or before it (priming bias). The outcome must be binary.

Usage

role_bounds(
  data,
  treat,
  outcome,
  moderator,
  design = c("post", "pre"),
  sensitivity = FALSE,
  ...
)

Arguments

data

A data frame.

treat, outcome, moderator

Character names of the binary treatment, binary outcome, and binary moderator.

design

"post" (moderator measured after treatment) or "pre" (measured before).

sensitivity

Logical. If TRUE, return the sensitivity analysis over the share of affected respondents (gamma for post, theta for pre) instead of the sharp bounds.

...

Further arguments passed to the prepost function, for example sims, g_by, g_max, t_by, moderator_mono, or stable_mod.

Value

The object returned by prepost::post_bounds, prepost::pre_bounds, prepost::post_sens, or prepost::pre_sens.

References

Blackwell, M., Brown, J. R., Hill, S., Imai, K., & Yamamoto, T. (2025). Priming bias versus post-treatment bias in experimental designs. Political Analysis, 33(4), 361-377.

Examples

if (FALSE) { # \dontrun{
data(land_experiment, package = "prepost")
post <- subset(land_experiment, prepost == 1)
role_bounds(post, "treat_comb", "support", "land_insecure", design = "post", sims = 200)
} # }