Skip to contents

Run sensitivity analysis on pre-test design

Usage

pre_sens(
  formula,
  data,
  moderator,
  t_by = 0.05,
  conf_level = 0.95,
  outcome_mono = 1L
)

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.

t_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.

conf_level

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

outcome_mono

A integer indicating the direction of the priming monotonicity assumption. The default value 1 indicates that asking the moderator question in the pre-test moves outcomes in a positive direction for all units. The value -1 indicates it moves outcomes in a negative direction for all units.

Value

A list object containing sensitivity output.

Examples

pre_sens(formula = angry_bin ~ t_commonality,
  data = delponte,
  moderator = ~ itaid_bin,
  t_by = 0.1
)
#> $thetas
#> [1] 0.0 0.1 0.2 0.3 0.4
#> 
#> $lower
#> [1] -0.2701678 -0.4701678 -0.6701678 -0.8701678 -1.0701678
#> 
#> $upper
#> [1] -0.2701678 -0.0701678  0.1298322  0.3298322  0.5298322
#> 
#> $ci_lower
#> [1] -0.4193849 -0.5954036 -0.7954036 -0.9954036 -1.1954036
#> 
#> $ci_upper
#> [1] -0.12095067  0.05506801  0.25506801  0.45506801  0.65506801
#>