kaplanMeier
plot.kaplanMeier(kmfit, conf.int=<<see below>>, col=1, lty=1, lwd=1, xlab="Survival Time", ylab="Proportion Surviving", xaxs=<<see below>>, add = F, ...)
"kaplanMeier"
, usually returned by the
kaplanMeier
function.
seq(length(kmfit$fits))
.
"Survival Time"
.
"Proportion Surviving"
.
xaxis
is missing or NULL the internal axis style is used
(xaxs=
i
) but only after the right endpoint has been extended by 4%.
TRUE
) to add the survival
curves to the current plot. Default is
FALSE
.
plot
function. In particular
main
and
xlim
arguments may be used to add a main title to the plot
and to set the x-axis limits to something other than the default.
This function may be used as both a high level and low level graphics
function via the
add
argument. When
add = T
the survival curves supplied
by
kmfit
are added to the current plot. For stratified fits, you can
select survival curves for particular strata and add them to an existing
plot by extracting the
"fits"
component of the kaplanMeier fit object and
then selecting the desired strata components. See the EXAMPLES section below
to see how this is done.
#simple stratified example leukemia.kap <- kaplanMeier(censor(time, status) ~ group, data = leukemia) plot(leukemia.kap, lty = 2:3) title("Kaplan-Meier Curves\nfor AML Maintenance Study") # example using the 'add' argument lung.kap <- kaplanMeier(censor(time, status) ~ inst, data = lung, na.action = na.exclude) # plot all the strata for the lung.kap fit plot(lung.kap) # plot only strata 1 and 5. Note: You must call 'plot.kaplanMeier' explicitly # because once you extract the fits component, the '"kaplanMeier"' class # structure is lost. plot.kaplanMeier(lung.kap$fits[c(1,5)]) #overlay stratum 9, adding confidence intervals plot.kaplanMeier(lung.kap$fits[9], add = T, conf.int = T, lty = 4)