lines.survfit(x, type = "s", mark = 3, col = 1, lty = 1, lwd = 1, mark.time = T, xscale = 1, yscale = 1, ...)
# 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)