https://github.com/DARTH-git/Cohort-modeling-tutorial/blob/e1cd8f3d9da878b89fd86449c15eab48a5cc1c25/analysis/STM_01.R#L105