Modeling Relative Survival/Excess Mortality using stpm2 (Part 2):

Flexible parametric modelling using restricted cubic splines

Miguel Angel Luque-Fernandez

Statistical methods for population-based cancer survival analysis (CIBERSP & VICA), Spain

Note: Adapted with permission from Paul Dickman and Paul Lambert short course in Trevisso, Italy

1. Calling Stata software from Jupyter Notebook

2. Load Data, merge expected mortality and fit inital model

3. Plot the predicted hazard and survival functions