Learn R Programming

flexsurv (version 0.1.5)

plot.flexsurvreg: Plots of fitted flexible survival models

Description

Plot fitted survival, cumulative hazard or hazard from a parametric model against nonparametric estimates to diagnose goodness-of-fit.

Usage

## S3 method for class 'flexsurvreg':
plot(x, X=NULL, type="survival", tmax=NULL,
        col.obs="black", lty.obs=1, lwd.obs=1, 
        col.fit="red", lty.fit=1, lwd.fit=2, add=FALSE,...)

Arguments

x
Output from flexsurvreg, representing a fitted survival model object.
X
Matrix of covariate values to produce fitted survival curves for. Columns represent different covariates, and rows represent multiple curves. For example matrix(c(1,2),nrow=2) if there is only one covariate in the model, and we w
type
"survival" for survival, to be plotted against Kaplan-Meier estimates from plot.survfit.

"cumhaz" for cumulative hazard, plotted against transformed Kapla

tmax
Maximum time point on the x-axis. By default, this is the maximum time observed in the data.
col.obs
Colour of the nonparametric curve.
lty.obs
Line type of the nonparametric curve.
lwd.obs
Line width of the nonparametric curve.
col.fit
Colour of the fitted parametric curve(s).
lty.fit
Line type of the fitted parametric curve(s).
lwd.fit
Line width of the fitted parametric curve(s).
add
If TRUE, add lines to an existing plot, otherwise new axes are drawn.
...
Other options to be passed to plot.survfit or muhaz, for example, to control the smoothness of the nonparametric hazard estimates. The

concept

Survival

See Also

flexsurvreg