*! version 1.0

Title

exptorcs -- a command to turn expected incidence/mortality rates into a spline-based
multiple-timescale merlin model object

Syntax

exptorcs
[varlist]
,
options

expdata(dataset) name of Stata dataset which contains the expected rates

event(varname) event indicator variable in expdata() file for Poisson model

exposure(varname) exposure time variable in expdata() file for Poisson model

year(varname, spline_options) restricted cubic spline model specification for calendar year; see details

age(varname, spline_options) restricted cubic spline model specification for attained age; see details

spline_options

knots(string) specify the knot locations (including boundary knots)

log create splines of log(varname)

noorthog suppress default orthogonalisation of spline variables

Description

exptorcs turns an expected incidence or mortality rate into a restricted cubic spline-based survival model,
i.e. a smooth parametric model for the rate, dependent on multiple timescales. It requires an incidence file which
contains the number of events and the total exposure time, stratified by appropriate variables such as age,
calendar year and sex. It first turns the rates into a Poisson based model, before transforming into a spline-based
survival model on the log hazard scale, using merlin. Once it is turned into a merlin model, it can
then be used as a transition model within a multi-state survival setting, using predictms. See
Weibull et al. (Submitted) for further details.

exptorcs is part of the merlin family. Further
details here: mjcrowther.co.uk/software/merlin

Options

options

expdata(dataset) specifies the name of Stata dataset which contains the expected rates to be turned into a spline based model using merlin.

event(varname) specifies the event indicator variable, which must be in expdata().

exposure(varname) specifies the exposure time variable, which must be in expdata().

year(varname, spline_options) specifies the restricted cubic spline model
for calendar year as a timescale. varname must be in the current dataset.

age(varname, spline_options) specifies the restricted cubic spline model
for attained age as a timescale. varname must be in the current dataset.

spline_options

The year() and age() options specify the restricted cubic spline expansion of the appropriate varname, with options:

knots(numlist) specifies the knot locations, which includes the boundary knots. Must be in ascending order.

log use splines of log varname rather than varname, the default.

noorthog suppress the default orthogonalisation of the spline variables.

Examples

exptorcs sex, expdata(popinc) event(_d) exposure(_t) ///

year(_year, knots(1980 1990 2000)) ///

age(_age, knots(25 50 75 85) log)

Authors

Michael J. Crowther

Biostatistics Research Group

Department of Health Sciences

University of Leicester

michael.crowther@le.ac.uk

Caroline E. Weibull

Department of Medicine

Karolinska Institutet

References

Crowther MJ. Extended multivariate generalised linear and non-linear mixed effects models.
https://arxiv.org/abs/1710.02223

Crowther MJ. merlin - a unified framework for data analysis and methods development in Stata.
https://arxiv.org/abs/1806.01615

Weibull CE, Lambert PC, Eloranta S, Andersson TM-L, Dickman PW, Crowther MJ. A multi-state model incorporating
estimation of excess hazards and multiple time scales. (Submitted).