[R] plot survival points
Thomas Lumley
tlumley at u.washington.edu
Thu May 2 20:48:19 CEST 2002
On Thu, 2 May 2002, Ronaldo Reis Jr. wrote:
>
> Hi Thomas
> I try it, but the graphic make is not a point graphic, is a ?scale? plot,
> like this:
>
> |_
> | |_
> | |
> | |__
> | |_
> | |_
> |_____________
>
> I need the same graphic, but with point like this:
>
> |
> | *
> | *
> | *
> | *
> | *
> |____________
>
Here's an example of superimposing points on lines for two groups
library(survival)
data(aml)
#fitted exponential models
curve(1-pexp(x,rate=0.04314),col="green",from=0,to=150)
curve(1-pexp(x,rate=0.01655),col="blue",from=0,to=150,add=TRUE)
fit <- survfit(Surv(time, status) ~ x, data = aml)
points(fit[1],col="blue")
points(fit[2],col="green")
-thomas
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list