Models for Multi-State Survival Data

Rates, Risks, and Pseudo-Values

Author

Per Kragh Andersen & Henrik Ravn

Published

October 22, 2023

Preface

This is the code companion website to our book published by Chapman & Hall.

R code with output for analyses and plots presented in the book is provided. Corresponding code in SAS with no output is given. Solutions to the exercises are available at the end of each chapter.

Please note:

  • A few places R or SAS code is not available (NA) and is denoted ‘R-NA’ and ‘SAS-NA’, respectively.
  • Code often depends on previous code in the same chapter including loading of required R packages.
  • R and SAS will not necessarily give exactly the same answers. For a comparison of coxph and SAS phreg see coxph vs. SAS phreg.
  • When using bootstrap and other re-sampling techniques, small deviations from the book will occur as no fixed seeds have been used.
  • R solutions to the exercises are also available as Quarto files (.qmd) in the R folder on github. SAS solutions are available as .sas files, see the exercises in the individual chapters.
  • Versions R-4.3.1 and SAS/STAT 15.1 were used.
  • We welcome suggested improvements of the code. Please use the ‘Report an issue’ facility below Table of contents.

A chapter with errata is also provided.

Acknowledgements

Sincerely thanks to Julie K. Furberg who created figures and validated analyses quoted in the book. Thanks to Eva N.S. Wandall who created solutions to practical exercises and contributed to some of the examples.

A special thank you goes to those who have provided data: Peter Aaby, Jules Angst, Flemming Bendtsen, John P. Klein, Bjørn S. Larsen, Thorkild I.A. Sørensen, Niels Tygstrup, and Tine Westergaard. Permission to present analyses of LEADER data was given by Novo Nordisk A/S.