Add Lines to a Survival Plot

DESCRIPTION:
Usually used to add the expected survival curve(s) to a Kaplan-Meier plot generated with plot.survfit.

USAGE:
lines.survfit(x, type = "s", mark = 3, col = 1, lty = 1, lwd = 1,
              mark.time = T, xscale  =  1, yscale  =  1, ...)

REQUIRED ARGUMENTS:
x:
a survival object, generated from the survfit or survexp functions.

OPTIONAL ARGUMENTS:
type:
the line type, as described in lines. The default is a step function for survfit objects, and a connected line for survexp objects.
mark,:
vectors giving the mark symbol, color, line type and line width for the added curves.
mark.time:
controls the labeling of the curves. If FALSE, no labeling is done. If TRUE, then curves are marked at each censoring time. If mark.time is a numeric vector, then curves are marked at the specified time points.
xscale:
a number used to divide the x values. If time was originally in days, a value of 365.24 would give a plotted scale in years.
yscale:
a number used to multiply the y values. A value of 100, for instance, will give a y axis in percent.

SIDE EFFECTS:
one or more curves are added to the current plot.

NOTE:
Does not yet handle confidence intervals.

SEE ALSO:
lines , par , plot.survfit , survfit , survexp .

EXAMPLES:
# First select by "id" those elements with the greater value of "stop"
hearta <- by(heart, heart$id, function(x)x[x$stop=max(x$stop),])

# Make the resulting list into a data frame by rebinding its components hearta <- do.call("rbind", hearta)

# plot the fitted survival curves plot(survfit(Surv(stop, event) ~ surgery, data = hearta), lty = 1:2)

# Add lines denoting the expected survival from National Rate Table lines(survexp (stop ~ surgery + ratetable(age = (age + 48) * 365.25, sex = "male", year = year * 365.25), data = hearta), mark = "E", mark.time = 1000, lty = 1:2, cex = 1.5)