Plot empirical and fitted survival curves
Description
Plot a Kaplan-Meier estimate of the survival probability and compare it with the fitted survival probability from amsm
model.
Usage
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, ...)
Arguments
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 "mean" , denoting the means of the covariates in
the data (this is the default),the number 0 , indicating that all the covariates should be
set to zero,or a list of values, with optional names. For example list (60, 1)
where the order of the list follows the order of the covariates originally given in the model formula, or a named list, list (age = 60, sex = 1)
|
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 interp="midpoint" then the entry time into the absorbing
state is assumed to be halfway between the time it is first observed
and the previous observation time. This is generally more reasonable
for "progressive" models with observations at arbitrary times. |
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. |
Details
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.
See Also
survfit
, plot.survfit
, plot.prevalence.msm
No comments:
Post a Comment
Thank you