library("causatr")
data("nhefs", package = "causatr")
fit <- causat(nhefs, outcome = "wt82_71", treatment = "qsmk",
confounders = ~ sex + age + wt71)
contrast(fit, interventions = list(quit = static(1), continue = static(0)))Set treatment to a fixed value
Description
Creates a static intervention that sets the treatment to a fixed value for all individuals at all time points. The most common intervention type, corresponding to "always treat" (static(1)) or "never treat" (static(0)).
Usage
static(value)
Arguments
value
|
The fixed treatment value. |
Value
A causatr_intervention object.
References
Hernan MA, Robins JM (2025). Causal Inference: What If. Chapman & Hall/CRC. Chapter 1 (static interventions).
See Also
shift(), dynamic(), scale_by(), threshold(), ipsi(), contrast()