Learn R Programming

⚠️There's a newer version (2.3.2) of this package.Take me there.

flexsurv (version 2.0)

Flexible Parametric Survival and Multi-State Models

Description

Flexible parametric models for time-to-event data, including the Royston-Parmar spline model, generalized gamma and generalized F distributions. Any user-defined parametric distribution can be fitted, given at least an R function defining the probability density or hazard. There are also tools for fitting and predicting from fully parametric multi-state models, based on either cause-specific hazards or mixture models.

Copy Link

Version

Install

install.packages('flexsurv')

Monthly Downloads

6,864

Version

2.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Christopher Jackson

Last Published

February 22nd, 2021

Functions in flexsurv (2.0)

GenGamma

Generalized gamma distribution
Survsplinek

Royston/Parmar spline survival distribution functions
WeibullPH

Weibull distribution in proportional hazards parameterisation
Llogis

The log-logistic distribution
GenF.orig

Generalized F distribution (original parameterisation)
ajfit

Aalen-Johansen nonparametric estimates comparable to a fitted flexsurvmix model
GenF

Generalized F distribution
Gompertz

The Gompertz distribution
Survspline

Royston/Parmar spline survival distribution
augment.flexsurvreg

Augment data with information from a flexsurv model object
bos

Bronchiolitis obliterans syndrome after lung transplants
GenGamma.orig

Generalized gamma distribution (original parameterisation)
.hessian

Numerical evaluation of the hessian of a function using numDeriv::hessian
basis

Natural cubic spline basis
ajfit_flexsurvmix

Forms a tidy data frame for plotting the fit of parametric mixture multi-state models against nonparametric estimates
ajfit_fmsm

Check the fit of Markov flexible parametric multi-state models against nonparametric estimates.
.hess_to_cov

helper function to safely convert a Hessian matrix to covariance matrix
flexsurvreg

Flexible parametric regression for time-to-event data
flexsurv-package

flexsurv: Flexible parametric survival and multi-state models
flexsurvspline

Flexible survival regression using the Royston/Parmar spline model.
flexsurvmix

Flexible parametric mixture models for times to competing events
fmixmsm

Constructor for a mixture multi-state model based on flexsurvmix
flexsurvrtrunc

Flexible parametric models for right-truncated, uncensored data defined by times of initial and final events.
bc

Breast cancer survival data
bootci.fmsm

Bootstrap confidence intervals for flexsurv output functions
nobs.flexsurvreg

Number of observations contributing to a fitted flexible survival model
glance.flexsurvreg

Glance at a flexsurv model object
normboot.flexsurvreg

Simulate from the asymptotic normal distribution of parameter estimates.
hexp

Hazard and cumulative hazard functions
lines.flexsurvreg

Add fitted flexible survival curves to a plot
pars.fmsm

Transition-specific parameters in a flexible parametric multi-state model
fmsm

Construct a multi-state model from a set of parametric survival models
p_flexsurvmix

Transition probabilities from a flexsurvmix model
sim.fmsm

Simulate paths through a fully parametric semi-Markov multi-state model
qgeneric

Generic function to find quantiles of a distribution
coef.flexsurvreg

Extract model coefficients from fitted flexible survival models
get_basepars

Evaluate baseline time-to-event distribution parameters given covariate values in a flexsurvmix model
msfit.flexsurvreg

Cumulative intensity function for parametric multi-state models
plot.flexsurvreg

Plots of fitted flexible survival models
qfinal_fmixmsm

Quantiles of the distribution of the time until reaching a final state in a mixture multi-state model
totlos.simfs

Expected total length of stay in specific states, from a fully-parametric, semi-Markov multi-state model
predict.flexsurvreg

Predictions from flexible survival models
rmst_flexsurvmix

Restricted mean times to events from a flexsurvmix model
mean_flexsurvmix

Mean times to events from a flexsurvmix model
meanfinal_fmixmsm

Mean time to final state in a mixture multi-state model
pfinal_fmsm

Probabilities of final states in a flexible parametric competing risks model
residuals.flexsurvreg

Calculate residuals for flexible survival models
rmst_generic

Generic function to find restricted mean survival of a distribution
unroll.function

Convert a function with matrix arguments to a function with vector arguments.
model.frame.flexsurvreg

Extract original data from flexsurvreg objects.
pmatrix.simfs

Transition probability matrix from a fully-parametric, semi-Markov multi-state model
ppath_fmixmsm

Probability of each pathway taken through a mixture multi-state model
probs_flexsurvmix

Probabilities of competing events from a flexsurvmix model
simt_flexsurvmix

Simulate times to competing events from a mixture multi-state model
simfs_bytrans

Reformat simulated multi-state data with one row per simulated transition
pmatrix.fs

Transition probability matrix from a fully-parametric, time-inhomogeneous Markov multi-state model
quantile_flexsurvmix

Quantiles of time-to-event distributions in a flexsurvmix model
tidy.flexsurvreg

Tidy a flexsurv model object
plot.survrtrunc

Plot nonparametric estimates of survival from right-truncated data.
mean_exp

Mean and restricted mean survival functions
totlos.fs

Total length of stay in particular states for a fully-parametric, time-inhomogeneous Markov multi-state model
simfinal_fmsm

Simulate and summarise final outcomes from a flexible parametric multi-state model
reexports

Objects exported from other packages
summary.flexsurvrtrunc

Summarise quantities of interest from fitted flexsurvrtrunc models
summary.flexsurvreg

Summaries of fitted flexible survival models
survrtrunc

Nonparametric estimator of survival from right-truncated, uncensored data