Description Usage Arguments Details Value Note Author(s) References See Also Examples
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.
1 2 |
surv |
a vector of survival values. |
time |
a vector of times. These are related to the
vector of survival by
Prob(X > time[i]) = surv[i]. If this vector
is not given then the default is to use
|
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). |
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.
Returns a plot or adds a line to an existing plot.
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.
Michael P. Fay
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.
1 2 3 4 5 6 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.