plot.survfit
.lines.survfit(x, type="s", mark=3, col=1, lty=1, lwd=1, mark.time=T,
xscale=1, firstx=0, firsty=1, xmax, fun, conf.int=F, ...)
points.survfit(object,...)
survfit
or survexp
functions.lines
. The default is a step function
for survfit
objects, and a connected line for survexp
objects.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 pointsNA
or xlim
graphical parameter, warning messages about out of bounds points are
not generated.fun=log
is an alternative way to draw a log-survival curve
(but with the axis labeled with log(S) values).
Four often used transformations can be specified wit"only"
, then only the CI bands are plotted, and the curve
itself is left off.
This can be useful for fine control over the colors or line types of a plot.x
and y
, containing the coordinates of the
last point on each of the curves (but not of the confidence limits).
This may be useful for labeling.lines
, par
, plot.survfit
, survfit
, survexp
.
# add expected survival curves for the two groups, # based on the US expected if (require(date)){ tdata <- data.frame(age=pbc$age*365.24, sex=pbc$sex +1, year= rep(mdy.date(1,1,1976), nrow(pbc))) tdata<-tdata[1:312,] ## only the randomised people, with no missing data data(ratetables) efit <- survexp(~ sex+ratetable(sex=sex,age=age,year=year), data=tdata, ratetable=survexp.us, times=(0:24)*182) temp <- lines(efit, lty=2, xscale=365.24, lwd=2:1) text(temp, c("Male", "Female"), adj= -.1) #labels just past the ends }
title(main="Primary Biliary Cirrhosis, Observed and Expected")