Run sensitivity analysis for the randomized moderator placement design
prepost_sens(
formula,
data,
moderator,
prepost,
g_by,
g_at,
t_by,
t_at,
sims = 1000,
stable_mod = FALSE,
conf_level = 0.95,
moderator_mono = NULL,
outcome_mono = NULL,
tau = 0.25,
progress = TRUE,
solver = "Rglpk"
)
A list object containing sensitivity output.
A formula with syntax y ~ t
, where y
is the
(unquoted) name of the outcome and t
is the (unquoted) name of the treatment.
A data.frame containing variables in the formula, moderator, and covariates arguments.
A one-sided formuala with syntax ~ d
, where d
is the (unquoted) name of the moderator variable for the CATE.
A one-sided formula with syntax ~ z, where z is the indicator variable for whether the moderator was measured pre- or post-treatment.
Numeric indicating the grid spacing for the \(\gamma\) parameter that places an upper bound on the proportion of units whose moderator is affected by treatment.
Vector specifying what values to set the \(\gamma\) parameter
to in the sensitivity analysis. Overrides g_by
.
Numeric indicating the grid spacing for the \(\theta\) parameter that restricts what proportion of units have their outcomes affected by the pre vs post-measurement of the moderator.
Vector specifying what values to set the \(\theta\) parameter
to in the sensitivity analysis. Overrides t_by
.
An integer indicating the number of simulations for the bootstrap confidence intervals for the bounds.
A logical value indicating if the bounds should assume that the moderator is unaffected by pre-vs-post measurement under the control condition.
A numeric indicating the confidence level for the bootstrap confidence intervals.
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.
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.
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.
A logical indicating if progress bars should be displayed. Defaults to TRUE.
A character indicating what linear programming solver to use: "Rglpk" (the default) or "lpSolve".
data(land_experiment)
prepost_sens(
support ~ treat_comb,
data = land_experiment,
moderator = ~ land_insecure,
prepost = ~ prepost,
g_by = 0.1,
t_at = c(0.25, 1),
sims = 50,
moderator_mono = NULL
)
Run the code above in your browser using DataLab