powered by
Compute difference in average outcomes above and below a dose threshold.
extract_threshold_effect(z, r, threshold)
the average of the outcomes with dose z above threshold c minus the average of the outcomes with dose z below the threshold c.
a vector of doses
a vector of outcomes
a dose threshold
# dose vector dose <- c(0, 0.1, 0.4) # outcome vector outcome <- c(1, 1.1, 1.5) theta <- extract_threshold_effect(z = dose, r = outcome, threshold = 0.3)
Run the code above in your browser using DataLab