Learn R Programming

doseSens (version 1.0.0)

extract_threshold_effect: Compute difference in average outcomes above and below a dose threshold.

Description

Compute difference in average outcomes above and below a dose threshold.

Usage

extract_threshold_effect(z, r, threshold)

Value

the average of the outcomes with dose z above threshold c minus the average of the outcomes with dose z below the threshold c.

Arguments

z

a vector of doses

r

a vector of outcomes

threshold

a dose threshold

Examples

Run this code
# 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