plot.rpsftm: Plot Method

View source: R/plot.rpsftm.R

plot.rpsftmR Documentation

Plot Method

Description

Function used to plot the KM curves of the treatment-free transformed times

Usage

## S3 method for class 'rpsftm'
plot(x, ...)

Arguments

x

an object returned from the rpsftm function.

...

further arguments passed to or from other methods.

Value

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

Author(s)

Simon Bond

Examples

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")

rpsftm documentation built on Nov. 2, 2023, 6:07 p.m.