threshold {gfoRmulaICE}R Documentation

Threshold

Description

This function specifies the threshold intervention on the treatment variable in data. If treatment value is between the lower bound and the upper bound, it follows the natural value of the treatment. If treatment value is either below the lower bound or above the upper bound, it is set to the lower bound or the upper bound, correspondingly. See Young et al. (2014) for more details.

Usage

threshold(lower_bound, upper_bound, var, data)

Arguments

lower_bound

a number indicating the lower bound of the threshold.

upper_bound

a number indicating the upper bound of the threshold.

var

a string specifying the treatment variable for the intervention.

data

a data frame containing the observed data.

Value

a vector containing the intervened values of the same size as the number of rows in data.

References

Young JG, Herńan MA, Robins JM. Identification, estimation and approximation of risk under interventions that depend on the natural value of treatment using observational data. Epidemiologic Methods. 2014;3(1):1-19.

Examples

data <- gfoRmulaICE::compData
threshold_treat <- threshold(lower_bound = 0, upper_bound = 2, var = "A1", data = data)

[Package gfoRmulaICE version 0.1.0 Index]