summary.flexsurvreg: Summaries of fitted flexible survival models

Description Usage Arguments Value Author(s) References See Also

View source: R/flexsurvreg.R


Return fitted survival, cumulative hazard or hazard at a series of times from a fitted flexsurvreg or flexsurvspline model.


## S3 method for class 'flexsurvreg'
summary(object, X=NULL, type="survival", t=NULL,
         start=NULL, B=1000, cl=0.95,...)



Output from flexsurvreg or flexsurvspline, representing a fitted survival model object.


Matrix of covariate values to produce fitted values for. Columns represent different covariates, and rows represent multiple combinations of covariate values. For example matrix(c(1,2),nrow=2) if there is only one covariate in the model, and we want survival for covariate values of 1 and 2.

For “factor” (categorical) covariates, the values of the contrasts representing factor levels (as returned by the contrasts function) should be used. For example, for a covariate agegroup specified as an unordered factor with levels 20-29, 30-39, 40-49, 50-59, and baseline level 20-29, there are three contrasts. To return summaries for groups 20-29 and 40-49, supply X = rbind(c(0,0,0), c(0,1,0)), since all contrasts are zero for the baseline level, and the second contrast is “turned on” for the third level 40-49.

If there are only factor covariates in the model, then all distinct groups are used by default.

If there are any continuous covariates, then a single summary is provided. By default, this is with all covariates set to their mean values in the data - for categorical covariates, the means of the 0/1 indicator variables are taken.


"survival" for survival probabilities.

"cumhaz" for cumulative hazards.

"hazard" for hazards.


Times to calculate fitted values for. By default, these are the sorted unique observation (including censoring) times in the data. If the corresponding left-truncation times start are not supplied, then they all default to 0.


Left-truncation times, defaults to those corresponding to the default t in the data.


Number of simulations from the normal asymptotic distribution of the estimates used to calculate confidence intervals. Decrease for greater speed at the expense of accuracy, or set B=0 to turn off calculation of CIs.


Width of symmetric confidence intervals, relative to 1.


Further arguments passed to or from other methods.


A list with one element for each unique covariate value (if there are only categorical covariates) or one element (if there are no covariates or any continuous covariates). Each of these elements is a matrix with one row for each time in t, giving the estimated survival (or cumulative hazard, or hazard) and 95% confidence limits. These list elements are named with the covariate names and values which define them.

If there are multiple summaries, an additional list component named X contains a matrix with the exact values of contrasts (dummy covariates) defining each summary.

The plot.flexsurvreg function can be used to quickly plot these model-based summaries against empirical summaries such as Kaplan-Meier curves, to diagnose model fit.

Confidence intervals for models fitted with flexsurvreg are obtained by random sampling from the asymptotic normal distribution of the maximum likelihood estimates (see, e.g. Mandel (2013)). For models fitted with flexsurvreg, intervals for the hazard are obtained in this way, whereas intervals for the survival and cumulative hazard are obtained analytically as in Royston and Parmar (2002).


C. H. Jackson


Royston, P. and Parmar, M. (2002). Flexible parametric proportional-hazards and proportional-odds models for censored survival data, with application to prognostic modelling and estimation of treatment effects. Statistics in Medicine 21(1):2175-2197.

Mandel, M. (2013). "Simulation based confidence intervals for functions with complicated derivatives." The American Statistician (in press).

See Also

flexsurvreg, flexsurvspline.

flexsurv documentation built on May 21, 2017, 3:53 a.m.

Search within the flexsurv package
Search all R packages, documentation and source code