Index: Stata tutorials

This page provides an index of some Stata tutorials, most of which are about survival analysis especially estimation and modelling of relative/net survival. My colleagues Paul Lambert and Michael Crowther have some excellent tutorials on similar and related topics.

Index of Stata tutorials on survival modelling

Approaches to age-standardisation

Index of tutorials on non-parametric estimation of relative/net survival in Stata (strs and stnet)

Extended index (with short summary of each page)

Matching an exposed cohort with an unexposed cohort

An illustration of how to randomly select up to 5 unexposed comparators matched on sex, year, and age (plus or minus 5 years)

Age-standardised survival using standsurv

After fitting a flexible parametric model, we estimate internally age-standardised 5-year survival for males and females for each year of diagnosis.

stcompadj: Estimating conditional cause-specific cumulative incidence functions in the presence of competing risks

Illustration of stcompadj using the example from the help file

Estimating a hazard ratio in the presence of effect modification

After fitting a flexible parametric model, we estimate and plot the hazard ratio for a covariate that is modified by another covariate.

Predicting in a new data set with merlin

Illustrates how to fit a model using patient data and then predict in a second dataset specifically constructed to contain only the covariates for which we wish to predict. Age is modelled using a restricted cubic spline.

Out-of-sample predictions and model-based age-standardistion with stpm2

Creating a second dataset in which to make predictions and an approach to model-based direct age-standardisation.

Predicting in a new data set with stpm2

Illustrates how to fit a model using patient data and then predict in a second dataset specifically constructed to contain only the covariates for which we wish to predict. Age is modelled using a restricted cubic spline.

Mediation analysis with survival data

We will partition the total effect of sex into the natural indirect effect (mediated by stage) and the natural direct effect. We then illustrate how to estimate the proportion of the sex difference mediated by stage. Emphasis is on illustrating how these quantities can be estimated in Stata using the standsurv command; we won't discuss the neccessary assumptions and their appropriateness.

Interpretation of interaction effects

Illustrates Stata factor variable notation and how to reparameterise a model to get the estimated effect of an exposure for each level of a modifier. Illustrates how we can fit a single model with interactions that is equivalent to stratified models.

Competing risks: Estimating crude probabilities of death

An illustration of how to estimate cumulative incidence functions (CIFs) based on a fitted flexible parametric model