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.
plot.survfit.msm(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", lwd=1, ...)
x |
Output from msm , representing a fitted
multi-state model object. |
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 "none" (the default) no confidence intervals are
plotted. If "normal" or "bootstrap" , confidence
intervals are plotted based on the respective method in
pmatrix.msm . This is very computationally-intensive,
since intervals must be computed at a series of times. |
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 interp="start" (the default) then the entry
time into the absorbing state is assumed to be the time it is first
observed in the data.
If |
legend.pos |
Vector of the x and y position, respectively, of the legend. |
xlab |
x axis label. |
ylab |
y axis label. |
lwd |
Line width. See par . |
... |
Other arguments to be passed to the
plot.survfit and lines.survfit functions. |
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