icplot {STAND} | R Documentation |
Plots Survival Functions
Description
This function takes a vector of survival values and a vector of time values and either plots a survival function or adds the survival lines to an existing plot.
Usage
icplot(surv, time = as.numeric(names(surv)), xrange = NA, lines.only = FALSE,
XLAB = "Time", YLAB = "Probability", LTY = 1, ...)
Arguments
surv |
a vector of survival values. |
time |
a vector of times. These are related to the
vector of survival by
|
xrange |
the range of the x values. The default is
|
lines.only |
a logical value; default = |
XLAB |
a character string denoting the x label. Default = "Time". |
YLAB |
a character string denoting the y label. Default = "Probability". |
LTY |
an integer denoting the line type (lty value). |
... |
additional plotting parameters (except xlab and ylab). |
Details
See icplot
details. This may not be the most accurate
way to present the data. See Betensky, Lindsey, Ryan,
and Wand (1999, p. 238) for an alternative method.
Value
Returns a plot or adds a line to an existing plot.
Note
The functions icfit
, icplot
,
and ictest
and documentation for these functions are from Michael P. Fay.
You are free to distribute these functions to whomever is
interested. They come with no warrantee however.
Author(s)
Michael P. Fay
References
Betensky, R. A., Lindsey, J. C., Ryan, L. M., and Wand, M. P. (1999), "Local EM Estimation of the Hazard Function for Interval-Censored Data," Biometrics, 55: 238-245.
See Also
Examples
# Plot two Survival curves on one plot.
# need data set for this example
# s1<- icfit(left[treatment==1],right[treatment==1])
# s2<- icfit(left[treatment==2],right[treatment==2])
# icplot(s1$surv,s1$time,xrange=range(c(s1$time,s2$time)))
# icplot(s2$surv,s2$time,lines.only=TRUE,LTY=2)