This function performs a line search over values of delta, the sensitivity parameter, in order to find (if it exists) delta*, the value of delta where the confidence interval no longer includes zero.

sensitivity_ds(Y, Z, R1, Attempt, R2, minY, maxY, sims = 100, strata = NULL,
  alpha = 0.05, data)

Arguments

Y

The (unquoted) outcome variable. Must be numeric.

Z

The (unquoted) assignment indicator variable. Must be numeric and take values 0 or 1.

R1

The (unquoted) initial sample respose indicator variable. Must be numeric and take values 0 or 1.

Attempt

The (unquoted) follow-up sample attempt indicator variable. Must be numeric and take values 0 or 1.

R2

The (unquoted) follow-up sample respose indicator variable. Must be numeric and take values 0 or 1.

minY

The minimum possible value of the outcome (Y) variable.

maxY

The maximum possible value of the outcome (Y) variable.

sims

Number of points at which to evaluate sensitivity test. Defaults to 100

strata

A single (unquoted) variable that indicates which strata units are in.

alpha

The desired significance level. 0.05 by default.

data

A dataframe

Value

A list containing a ggplot object, a dataframe of simulated bounds and cis, and a value of pstar, if it exists.