The supplemental .zip archive for this publication contains the following files: 1. An R file which installs the packages required to run the code install_packages.r 2. An R file which performs the forward selection process as described in Section 5.2 sec5.2.r 3. An R file which performs the quantitative comparison with standard approaches as described in Section 5.3 sec5.3.r 4. An R file which plots smooth terms and fitted probabilities, as demonstrated in Section 6 sec6.r 5. An R file which contains a series of functions that are required to run the code (this is sourced within the R code of files 2-4 so does not need to be run separately) functions.r Please note the following before use: 1. The main R files (2-4) are designed to be followed sequentially. 2. The code requires the user to have a sample of person-year records containing the covariates specified in the paper, as well as corresponding survey weights. Further details are given at the start of file 2 (sec5.2.r). As such, the code cannot be sourced immediately and will need to be adapted to the specific data that the user has. 3. After downloading the files, the user should create a folder called 'output' and a folder called 'plots' in the same location, as the code will save to these folders. R version 4.0.2 was used to generate the code.