make.surv: Engine for Probabilistic Sensitivity Analysis on the survival...

View source: R/make.surv.R

make.survR Documentation

Engine for Probabilistic Sensitivity Analysis on the survival curves

Description

Creates the survival curves for the fitted model(s)

Usage

make.surv(fit, mod = 1, t = NULL, newdata = NULL, nsim = 1, ...)

Arguments

fit

the result of the call to the fit.models function, containing the model fitting (and other relevant information)

mod

the index of the model. Default value is 1, but the user can choose which model fit to visualise, if the call to fit.models has a vector argument for distr (so many models are fitted & stored in the same object)

t

the time vector to be used for the estimation of the survival curve

newdata

a list (of lists), specifying the values of the covariates at which the computation is performed. For example list(list(arm=0),list(arm=1)) will create two survival curves, one obtained by setting the covariate arm to the value 0 and the other by setting it to the value 1. In line with flexsurv notation, the user needs to either specify the value for all the covariates or for none (in which case, newdata=NULL, which is the default). If some value is specified and at least one of the covariates is continuous, then a single survival curve will be computed in correspondence of the average values of all the covariates (including the factors, which in this case are expanded into indicators).

nsim

The number of simulations from the distribution of the survival curves. Default at nsim=1, in which case uses the point estimate for the relevant distributional parameters and computes the resulting survival curve

...

Additional options

Author(s)

Gianluca Baio

References

G Baio (2019). survHE: Survival analysis for health economic evaluation and cost-effectiveness modelling. Journal of Statistical Software (2020). vol 95, 14, 1-47. doi:10.18637/jss.v095.i14

See Also

fit.models, psa.plot, write.surv

Examples

## Not run:  
# Loads an example dataset from 'flexsurv'
data(bc)

# Fits the same model using the 3 inference methods
mle <- fit.models(formula=Surv(recyrs,censrec) ~ group, data=bc,
                  distr="exp", method="mle")
p.mle <- make.surv(mle)
psa.plot(p.mle)

# Can also use the main 'plot' function to visualise the survival curves
# and include uncertainty by using a number 'nsim' of simulations
plot(mle, nsim=10)

## End(Not run)


giabaio/survHE documentation built on Sept. 9, 2023, 2:47 a.m.