| id_tsi | R Documentation |
id_tsi() identifies the number of time periods relative to the intervention
for each observation. This information is used for plotting and for
aggregating model coefficients with ave_coeff().
id_tsi(df, cohort_var, time_var, intervention_var)
df |
Data frame containing the variables in the model. |
cohort_var |
Name of the variable in |
time_var |
Name of the variable in |
intervention_var |
Name of the cohort-level variable in |
tsi Object containing a data frame showing time since intervention
for each time period in the data frame for each cohort in the data frame.
# Generate a tsi object, containing a data frame showing the time since
# intervention (TSI value) for each time period in the data frame for each
# cohort.
id_tsi(hosp,
cohort_var = "cohort",
time_var = "yr",
intervention_var = "intervention_yr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.