plot.survfit.msm {msm} | R Documentation |
Plot a Kaplan-Meier estimate of the survival probability and compare
it with the fitted survival probability from a msm
model.
## S3 method for class 'survfit.msm' plot(x, from=1, to=NULL, range=NULL, covariates="mean", interp=c("start","midpoint"), ci=c("none","normal","bootstrap"), B=100, legend.pos=NULL, xlab="Time", ylab="Survival probability", lty=1, lwd=1, col="red", lty.ci=2, lwd.ci=1, col.ci="red", mark.time=TRUE, col.surv="blue", lty.surv=2, lwd.surv=1, ...)
x |
Output from |
from |
State from which to consider survival. Defaults to state 1. |
to |
Absorbing state to consider. Defaults to the highest-labelled absorbing state. |
range |
Vector of two elements, giving the range of times to plot for. |
covariates |
Covariate values for which to evaluate the expected
probabilities. This can either be: the string the number or a list of values, with optional names. For example
where the order of the list follows the order of the covariates originally given in the model formula, or a named list,
|
ci |
If |
B |
Number of bootstrap or normal replicates for the confidence interval. The default is 100 rather than the usual 1000, since these plots are for rough diagnostic purposes. |
interp |
If If |
legend.pos |
Vector of the x and y position, respectively, of the legend. |
xlab |
x axis label. |
ylab |
y axis label. |
lty |
Line type for the fitted curve. See |
lwd |
Line width for the fitted curve. See |
col |
Colour for the fitted curve. See |
lty.ci |
Line type for the fitted curve confidence limits. See |
lwd.ci |
Line width for the fitted curve confidence limits. See |
col.ci |
Colour for the fitted curve confidence limits. See |
mark.time |
Mark the empirical survival curve at each censoring
point, see |
col.surv |
Colour for the empirical survival curve, passed to |
lty.surv |
Line type for the empirical survival curve, passed to |
lwd.surv |
Line width for the empirical survival curve, passed to |
... |
Other arguments to be passed to the
|
If the data represent observations of the process at arbitrary times, then the first occurrence of the absorbing state in the data will usually be greater than the actual first transition time to that state. Therefore the Kaplan-Meier estimate of the survival probability will be an overestimate.
This currently only handles time-homogeneous models.
survfit
, plot.survfit
, plot.prevalence.msm