# 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")
Run the code above in your browser using DataLab