plot.rpsftm | R Documentation |
Function used to plot the KM curves of the treatment-free transformed times
## S3 method for class 'rpsftm'
plot(x, ...)
x |
an object returned from the |
... |
further arguments passed to or from other methods. |
a ggplot plot of the fitted KM curves. The underlying data.frame has variables
time: failure time
survival: estimated treatment-free survival probability
upper: upper confidence interval at level defined by alpha in the call to rpsftm
lower: lower confidence interval at level defined by alpha in the call to rpsftm
group: randomised treatment arm
Simon Bond
fit <- rpsftm(Surv(progyrs, prog)~rand(imm,1-xoyrs/progyrs),immdef, censyrs)
plot(fit)
library(ggplot2)
plot(fit)+
scale_linetype_discrete(labels=c("Control","Experimental"))+
ylim(0.5,1)+
geom_ribbon(aes(ymin=lower, ymax=upper, fill=group), alpha=0.3)+
labs(x="Time (years)", title=NULL, lty="Arm", fill="Arm")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.