Skip to contents

Run post-treatment bounds.

Usage

post_bounds(
  formula,
  data,
  moderator,
  sims = 1000,
  conf_level = 0.95,
  moderator_mono = NULL,
  stable_mod = FALSE,
  nondiff = FALSE,
  progress = TRUE
)

Arguments

formula

A formula with syntax y ~ t, where y is the (unquoted) name of the outcome and t is the (unquoted) name of the treatment.

data

A data.frame containing variables in the formula, moderator, and covariates arguments.

moderator

A one-sided formuala with syntax ~ d, where d is the (unquoted) name of the moderator variable for the CATE.

sims

An integer indicating the number of simulations for the bootstrap confidence intervals for the bounds.

conf_level

A numeric indicating the confidence level for the bootstrap confidence intervals.

moderator_mono

A integer or vector of length 2 indicating if the bounds should assume monotonicity of the effect of the post-test on the moderator with 1 indicating that the post-test effect is positive and -1 indicating that it is negative. The vector of length 2 allows the monotonicity assumption to vary by treatment status with the first entry being for control and the second for treated.

stable_mod

A logical value indicating if the bounds should assume that the moderator is unaffected by pre-vs-post measurement under the control condition.

nondiff

A logical value indicating if the bounds should assume the treatment effect on the moderator is independent of the potential outcomes.

progress

A logical indicating if progress bars should be displayed. Defaults to TRUE.

Value

A list object containing bounds.

Examples

data(delponte)
post_bounds(
  formula = angry_bin ~ t_commonality,
   data = delponte,
  moderator = ~ itaid_bin
)
#> Bootstrap running...
#> 0% |==                  | 100%
#> 0% |====                | 100%
#> 0% |======              | 100%
#> 0% |========            | 100%
#> 0% |==========          | 100%
#> 0% |============        | 100%
#> 0% |==============      | 100%
#> 0% |================    | 100%
#> 0% |==================  | 100%
#> 0% |====================| 100%
#> $lower
#> [1] -1.4
#> 
#> $upper
#> [1] 1.4
#> 
#> $ci_lower
#> [1] -1.45455
#> 
#> $ci_upper
#> [1] 1.45455
#> 
#> $post_est
#> [1] -0.2701678
#>