Supplementary material for:
Costeffectiveness analysis in R using a multistate modelling survival analysis framework: A tutorial
All of the files detailed below can be downloaded from the zip.file tutorial files *UPDATED  March 2019*
The R commands.R file should be opened and run in R. It will read into R the example dataset and the R functions and other R programs detailed below used to implement the multistate modelling approach.
File  Description 
Algorithm step (if applicable) 
FILES DEMONSTRATING THE APPROACH 

data.txt  example dataset used in the tutorial  
R commands.R 
syntax used for the full costeffectiveness analysis shown in the tutorial 

SEPARATE R PROGRAMS RUN FROM WITHIN R COMMANDS.R 

assessment of fit for prog to death.R  assessment of fit for the progression to death transition  4 
building all combinations of msms.R 
builds all combinations of models using each distribution for each transition, for each treatment arm separately 
4 
visual assessment of fit for progressionfree to progression.R  plots to assess the fit for progressionfree to progression  4 
visual assessment of fit for progressionfree to death.R  plots to assess the fit for progressionfree to death  4 
one way sens.R  oneway sensitivity analysis 
7 
sensitivity analysis  alternative fits ICERs table.R  oneway sensitivity analysis considering alternative distributions  7 
BASE CASE ANALYSIS 

function modelparam.R 
R function that displays the coefficients after fitting a parametric survival regression 
2 
function Markov.R  R function to fit a Markov parametric multistate model  3,7 
function semiMarkov.R  R function to fit a semiMarkov parametric multistate model  3,7 
README file.txt 
description of how to overcome a warning with the Markov or semiMarkov functions 
3,7 
function MarkovHaz.R  R function to help overcome a warning with the Markov function  3,7 
function semiMarkovHaz.R 
R function to help overcome a warning with the semiMarkov function 
3,7 
function visualMarkov.R  R function to visually assess the fits of a Markov parametric multistate model  4 
function visualsemiMarkov.R  R function to visually assess the fits of a semiMarkov parametric multistate model  4 
function proportion.R  R function to create the observed proportion in the intermediate state  4 
function meanLY.R  R function to create the mean Life Years in a given state for a given treatment arm  5 
ONEWAY SENSITIVITY ANALYSIS 

function Markov_notrteffect.R  R function to remove treatment effect in extrapolation period  7 
function Markov_varyHR.R  R function to vary hazard ratio in extrapolation period  7 
function semiMarkov_notrteffect.R  R function to remove treatment effect in extrapolation period  7 
function semiMarkov_varyHR.R  R function to vary hazard ratio in extrapolation period  7 
PROBABILISTIC SENSITIVITY ANALYSIS 

function PSAprob.R  R function that returns the state occupancy probabilities for each draw  8 
function PSAmeanLY.R  R function that returns the mean Life Years in a given state for a given treatment arm, by calculating the mean across each draw in the PSA  9 
function PSAQALY.R  R function that returns the QALYs in a given state for a given treatment arm  9 
function CEplane.R  R function to plot a costeffectiveness plane  11 
function CEAC.R  R function to plot a costeffectiveness acceptability curve  12 
FUNCTIONS THAT CAN BE USED WHEN INDIVIDUAL PATIENT DATA (IPD) IS NOT AVAILABLE 

function Markov_noipd.R  R function that fits a Markov multistate model when IPD is not available  
function semiMarkov_noipd.R  R function that fits a semiMarkov multistate model when IPD is not available  
function Haz_noipd.R  R function to help overcome a warning with the Markov_noipd.R or semiMarkov_noipd.R functions 