grace_period | R Documentation |
This function specifies an intervention in which treatment is initiated within the grace period of nperiod
time units.
During the grace period, the treatment variable follows its natural value or initiate intervention with a uniform distribution at each time point.
grace_period(type, nperiod, condition, data, id, time_name, outcome_name)
type |
a string specifying the type of grace period strategy. Possible values are "uniform" and "natural". |
nperiod |
a number indicating the length of grace period. |
condition |
a string specifying the logical expression, upon which is met, the treatment is initiated within |
data |
a data frame containing the observed data. |
id |
a string specifying the ID variable name in |
time_name |
a string specifying the time variable name in |
outcome_name |
a string specifying the outcome variable name in |
a vector containing the intervened value of the same size as the number of rows in data
.
data <- gfoRmulaICE::compData
grace_period <- grace_period(type = "uniform", nperiod = 2, condition = "L1 == 0",
data = data, id = "id", time_name = "t0", outcome_name = "Y")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.