Run Prepost bounds
Usage
prepost_bounds(
formula,
data,
moderator,
prepost,
sims = 1000,
conf_level = 0.95,
moderator_mono = NULL,
outcome_mono = NULL,
stable_mod = FALSE,
tau = 0.25,
progress = TRUE
)
Arguments
- formula
A formula with syntax
y ~ t
, wherey
is the (unquoted) name of the outcome andt
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
, whered
is the (unquoted) name of the moderator variable for the CATE.- prepost
A one-sided formula with syntax ~ z, where z is the indicator variable for whether the moderator was measured pre- or post-treatment.
- sims
An integer specifying the number of simulations for the sensitivity analysis.
- conf_level
A numeric specifying level for the 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.- outcome_mono
A integer or vector of length 2 indicating if the bounds should assume monotonicity of the effect of the post-test on the outcome 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.
- tau
A numeric indicating how close the the moment conditions of the estimated bounds have to be from the minimum values in the sample. This allows us to obtain bounds and confidence intevals even when the assumptions are slightly violated due to sampling.
- progress
A logical indicating if progress bars should be displayed. Defaults to TRUE.