Package: flexsurv 2.3.3

flexsurv: Flexible Parametric Survival and Multi-State Models

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.

Authors:Christopher Jackson [aut, cre], Paul Metcalfe [ctb], Jordan Amdahl [ctb], Matthew T. Warkentin [ctb], Michael Sweeting [ctb], Kevin Kunzmann [ctb]

flexsurv_2.3.3.tar.gz
flexsurv_2.3.3.zip(r-4.5)flexsurv_2.3.3.zip(r-4.4)flexsurv_2.3.3.zip(r-4.3)
flexsurv_2.3.3.tgz(r-4.4-x86_64)flexsurv_2.3.3.tgz(r-4.4-arm64)flexsurv_2.3.3.tgz(r-4.3-x86_64)flexsurv_2.3.3.tgz(r-4.3-arm64)
flexsurv_2.3.3.tar.gz(r-4.5-noble)flexsurv_2.3.3.tar.gz(r-4.4-noble)
flexsurv_2.3.3.tgz(r-4.4-emscripten)flexsurv_2.3.3.tgz(r-4.3-emscripten)
flexsurv.pdf |flexsurv.html
flexsurv/json (API)
NEWS

# Install 'flexsurv' in R:
install.packages('flexsurv', repos = c('https://chjackson.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/chjackson/flexsurv/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • bc - Breast cancer survival data
  • bosms3 - Bronchiolitis obliterans syndrome after lung transplants
  • bosms4 - Bronchiolitis obliterans syndrome after lung transplants

On CRAN:

13.27 score 55 stars 39 packages 600 scripts 8.2k downloads 39 mentions 191 exports 53 dependencies

Last updated 1 months agofrom:eb7e61bff4. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 22 2024
R-4.5-win-x86_64OKNov 22 2024
R-4.5-linux-x86_64OKNov 22 2024
R-4.4-win-x86_64OKNov 22 2024
R-4.4-mac-x86_64OKNov 22 2024
R-4.4-mac-aarch64OKNov 22 2024
R-4.3-win-x86_64OKNov 22 2024
R-4.3-mac-x86_64OKNov 22 2024
R-4.3-mac-aarch64OKNov 22 2024

Exports:AICcAICCajfitajfit_flexsurvmixajfit_fmsmaugmentbasisbootci.fmsmcoxsnell_flexsurvregdbasisdfssdgenfdgenf.origdgengammadgengamma.origdgompertzdllogisdsurvsplinedsurvspline0dsurvspline1dsurvspline2dsurvspline3dsurvspline4dsurvspline5dsurvspline6dsurvspline7dweibullPHflexsurv.distsflexsurvmixflexsurvregflexsurvrtruncflexsurvsplinefmixmsmfmsmfssglancehexpHexphgammaHgammahgenfHgenfhgenf.origHgenf.orighgengammaHgengammahgengamma.origHgengamma.orighgompertzHgompertzhllogisHllogishlnormHlnormhr_flexsurvreghsurvsplineHsurvsplinehsurvspline0Hsurvspline0hsurvspline1Hsurvspline1hsurvspline2Hsurvspline2hsurvspline3Hsurvspline3hsurvspline4Hsurvspline4hsurvspline5Hsurvspline5hsurvspline6Hsurvspline6hsurvspline7Hsurvspline7hweibullHweibullhweibullPHHweibullPHmean_expmean_flexsurvmixmean_gammamean_genfmean_genf.origmean_gengammamean_gengamma.origmean_gompertzmean_llogismean_lnormmean_survsplinemean_survspline0mean_survspline1mean_survspline2mean_survspline3mean_survspline4mean_survspline5mean_survspline6mean_survspline7mean_weibullmean_weibullPHmeanfinal_fmixmsmmsfit.flexsurvregnormboot.flexsurvregp_flexsurvmixpars.fmsmpdf_flexsurvmixpfinal_fmsmpgenfpgenf.origpgengammapgengamma.origpgompertzpllogispmatrix.fspmatrix.simfsppath_fmixmsmprobs_flexsurvmixpsurvsplinepsurvspline0psurvspline1psurvspline2psurvspline3psurvspline4psurvspline5psurvspline6psurvspline7pweibullPHqfinal_fmixmsmqgenericqgenfqgenf.origqgengammaqgengamma.origqgompertzqllogisqsurvsplineqsurvspline0qsurvspline1qsurvspline2qsurvspline3qsurvspline4qsurvspline5qsurvspline6qsurvspline7quantile_flexsurvmixqweibullPHrgenfrgenf.origrgengammargengamma.origrgompertzrllogisrmst_exprmst_flexsurvmixrmst_gammarmst_genericrmst_genfrmst_genf.origrmst_gengammarmst_gengamma.origrmst_gompertzrmst_llogisrmst_lnormrmst_survsplinermst_survspline0rmst_survspline1rmst_survspline2rmst_survspline3rmst_survspline4rmst_survspline5rmst_survspline6rmst_survspline7rmst_weibullrmst_weibullPHrsurvsplinersurvspline0rsurvspline1rsurvspline2rsurvspline3rsurvspline4rsurvspline5rsurvspline6rsurvspline7rweibullPHsim.fmsmsimfinal_fmsmsimfs_bytransstandsurvsurvrtrunctidytotlos.fstotlos.simfsunroll.function

Dependencies:assertthatbbmlebdsmatrixBHclicolorspacecpp11data.tabledeSolvedplyrfansifarverfastGHQuadgenericsggplot2gluegtableisobandlabelinglatticelifecyclemagrittrMASSMatrixmgcvmstatemuhazmunsellmvtnormnlmenumDerivpillarpkgconfigpurrrquadprogR6RColorBrewerRcppRcppArmadillorlangrstpm2scalesstatmodstringistringrsurvivaltibbletidyrtidyselectutf8vctrsviridisLitewithr

Calculating standardized survival measures in flexsurv

Rendered fromstandsurv.Rmdusingknitr::rmarkdownon Nov 22 2024.

Last update: 2023-04-17
Started: 2022-04-07

Distributions reference

Rendered fromdistributions.Rnwusingutils::Sweaveon Nov 22 2024.

Last update: 2024-10-15
Started: 2020-11-27

flexsurv user guide

Rendered fromflexsurv.Rnwusingknitr::knitron Nov 22 2024.

Last update: 2024-04-16
Started: 2014-07-29

Multi-state modelling with flexsurv

Rendered frommultistate.Rnwusingknitr::knitron Nov 22 2024.

Last update: 2023-01-31
Started: 2020-09-06

Supplementary examples of using flexsurv

Rendered fromflexsurv-examples.Rnwusingutils::Sweaveon Nov 22 2024.

Last update: 2021-11-15
Started: 2014-08-05

Readme and manuals

Help Manual

Help pageTopics
flexsurv: Flexible parametric survival and multi-state modelsflexsurv-package flexsurv
Akaike's information criterion from a flexible parametric multistate modelAIC.fmsm
Second-order Akaike information criterionAICC AICc
Second-order Akaike information criterionAICC.flexsurvreg AICc.flexsurvreg
Aalen-Johansen nonparametric estimates comparable to a fitted flexsurvmix modelajfit
Forms a tidy data frame for plotting the fit of parametric mixture multi-state models against nonparametric estimatesajfit_flexsurvmix
Check the fit of Markov flexible parametric multi-state models against nonparametric estimates.ajfit_fmsm
Augment data with information from a flexsurv model objectaugment.flexsurvreg
Natural cubic spline basisbasis dbasis dfss fss
Breast cancer survival databc
Bayesian Information Criterion (BIC) for comparison of flexsurvreg modelsBIC.flexsurvreg
Bootstrap confidence intervals for flexsurv output functionsbootci.fmsm
Bronchiolitis obliterans syndrome after lung transplantsbos bosms3 bosms4
Extract model coefficients from fitted flexible survival modelscoef.flexsurvreg
Cox-Snell residuals from a parametric survival modelcoxsnell_flexsurvreg
Flexible parametric mixture models for times to competing eventsflexsurvmix
Flexible parametric regression for time-to-event dataflexsurv.dists flexsurvreg
Flexible parametric models for right-truncated, uncensored data defined by times of initial and final events.flexsurvrtrunc
Flexible survival regression using the Royston/Parmar spline model.flexsurvspline
Constructor for a mixture multi-state model based on flexsurvmixfmixmsm
Construct a multi-state model from a set of parametric survival modelsfmsm
Generalized F distributiondgenf GenF Hgenf hgenf pgenf qgenf rgenf
Generalized F distribution (original parameterisation)dgenf.orig GenF.orig Hgenf.orig hgenf.orig pgenf.orig qgenf.orig rgenf.orig
Generalized gamma distributiondgengamma GenGamma Hgengamma hgengamma pgengamma qgengamma rgengamma
Generalized gamma distribution (original parameterisation)dgengamma.orig GenGamma.orig Hgengamma.orig hgengamma.orig pgengamma.orig qgengamma.orig rgengamma.orig
Evaluate baseline time-to-event distribution parameters given covariate values in a flexsurvmix modelget_basepars
Glance at a flexsurv model objectglance.flexsurvreg
The Gompertz distributiondgompertz Gompertz Hgompertz hgompertz pgompertz qgompertz rgompertz
Hazard and cumulative hazard functionshazard Hexp hexp Hgamma hgamma Hlnorm hlnorm Hweibull hweibull
Hazard ratio as a function of time from a parametric survival modelhr_flexsurvreg
Add fitted flexible survival curves to a plotlines.flexsurvreg
The log-logistic distributiondllogis Hllogis hllogis Llogis pllogis qllogis rllogis
Log likelihood from a flexsurvreg modellogLik.flexsurvreg
Mean and restricted mean survival functionsmeans mean_exp mean_gamma mean_genf mean_genf.orig mean_gengamma mean_gengamma.orig mean_gompertz mean_llogis mean_lnorm mean_weibull mean_weibullPH rmst_exp rmst_gamma rmst_genf rmst_genf.orig rmst_gengamma rmst_gengamma.orig rmst_gompertz rmst_llogis rmst_lnorm rmst_weibull rmst_weibullPH
Mean times to events from a flexsurvmix modelmean_flexsurvmix
Mean time to final state in a mixture multi-state modelmeanfinal_fmixmsm
Model frame from a flexsurvmix objectmodel.frame.flexsurvmix
Extract original data from 'flexsurvreg' objects.model.frame.flexsurvreg model.matrix.flexsurvreg
Cumulative intensity function for parametric multi-state modelsmsfit.flexsurvreg
Number of observations contributing to a fitted flexible survival modelnobs.flexsurvreg
Simulate from the asymptotic normal distribution of parameter estimates.normboot.flexsurvreg
Transition probabilities from a flexsurvmix modelp_flexsurvmix
Transition-specific parameters in a flexible parametric multi-state modelpars.fmsm
Fitted densities for times to events in a flexsurvmix modelpdf_flexsurvmix
Probabilities of final states in a flexible parametric competing risks modelpfinal_fmsm
Plots of fitted flexible survival modelsplot.flexsurvreg
Plot standardized metrics from a fitted flexsurv modelplot.standsurv
Plot nonparametric estimates of survival from right-truncated data.lines.survrtrunc plot.survrtrunc
Transition probability matrix from a fully-parametric, time-inhomogeneous Markov multi-state modelpmatrix.fs
Transition probability matrix from a fully-parametric, semi-Markov multi-state modelpmatrix.simfs
Probability of each pathway taken through a mixture multi-state modelppath_fmixmsm
Predictions from flexible survival modelspredict.flexsurvreg
Probabilities of competing events from a flexsurvmix modelprobs_flexsurvmix
Quantiles of the distribution of the time until reaching a final state in a mixture multi-state modelqfinal_fmixmsm
Generic function to find quantiles of a distributionqgeneric
Quantiles of time-to-event distributions in a flexsurvmix modelquantile_flexsurvmix
Calculate residuals for flexible survival modelsresiduals.flexsurvreg
Restricted mean times to events from a flexsurvmix modelrmst_flexsurvmix
Generic function to find restricted mean survival time for some distributionrmst_generic
Simulate paths through a fully parametric semi-Markov multi-state modelsim.fmsm
Simulate and summarise final outcomes from a flexible parametric multi-state modelsimfinal_fmsm
Reformat simulated multi-state data with one row per simulated transitionsimfs_bytrans
Simulate times to competing events from a mixture multi-state modelsimt_flexsurvmix
Simulate censored time-to-event data from a fitted flexsurvreg modelsimulate.flexsurvreg
Marginal survival and hazards of fitted flexsurvreg modelsstandsurv
Summaries of fitted flexible survival modelssummary.flexsurvreg
Summarise quantities of interest from fitted flexsurvrtrunc modelssummary.flexsurvrtrunc
Nonparametric estimator of survival from right-truncated, uncensored datasurvrtrunc
Royston/Parmar spline survival distributiondsurvspline Hsurvspline hsurvspline mean_survspline psurvspline qsurvspline rmst_survspline rsurvspline Survspline
Royston/Parmar spline survival distribution functions with one argument per parameterdsurvspline0 dsurvspline1 dsurvspline2 dsurvspline3 dsurvspline4 dsurvspline5 dsurvspline6 dsurvspline7 Hsurvspline0 hsurvspline0 Hsurvspline1 hsurvspline1 Hsurvspline2 hsurvspline2 Hsurvspline3 hsurvspline3 Hsurvspline4 hsurvspline4 Hsurvspline5 hsurvspline5 Hsurvspline6 hsurvspline6 Hsurvspline7 hsurvspline7 mean_survspline0 mean_survspline1 mean_survspline2 mean_survspline3 mean_survspline4 mean_survspline5 mean_survspline6 mean_survspline7 psurvspline0 psurvspline1 psurvspline2 psurvspline3 psurvspline4 psurvspline5 psurvspline6 psurvspline7 qsurvspline0 qsurvspline1 qsurvspline2 qsurvspline3 qsurvspline4 qsurvspline5 qsurvspline6 qsurvspline7 rmst_survspline0 rmst_survspline1 rmst_survspline2 rmst_survspline3 rmst_survspline4 rmst_survspline5 rmst_survspline6 rmst_survspline7 rsurvspline0 rsurvspline1 rsurvspline2 rsurvspline3 rsurvspline4 rsurvspline5 rsurvspline6 rsurvspline7 Survsplinek
Tidy a flexsurv model objecttidy.flexsurvreg
Tidy a standsurv object.tidy.standsurv
Total length of stay in particular states for a fully-parametric, time-inhomogeneous Markov multi-state modeltotlos.fs
Expected total length of stay in specific states, from a fully-parametric, semi-Markov multi-state modeltotlos.simfs
Convert a function with matrix arguments to a function with vector arguments.unroll.function
Variance-covariance matrix from a flexsurvreg modelvcov.flexsurvreg
Weibull distribution in proportional hazards parameterisationdweibullPH HweibullPH hweibullPH pweibullPH qweibullPH rweibullPH WeibullPH