Description Usage Arguments Examples
This function cuts the progression data according to the scan intervals. The observed PD date is determined by the immediate scan following the unobservable true PD date. The scan interval should be considered only for events after incorporating drop-off process. Data cutoff process, if needed, should follow the scan interval consideration. The event status should not be changed after considering the scan interval.
1 2 3 4 5 6 7 |
cnsr |
Censor status variable (0: event; 1: censored) |
treatment |
Treatment arm code (0: control arm; 1: experimental arm) |
scanfreq0 |
A vector of scan frequency for control arm, eg, every 6 weeks for 2 scans, then every 9 weeks thereafter. scanfreq = c(rep(6, 2), rep(9, 1000))*7 |
scanfreq1 |
A vector of scan frequency for experimental arm, eg, every 6 weeks for 2 scans, then every 9 weeks thereafter. scanfreq = c(rep(6, 2), rep(9, 1000))*7 |
PFS |
Time to event variable |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #Example: Simulate 1 sample from proportional hazards scenario.
#Total 600 pts, 1:1 randomization, control median PFS 8 mo;
#HR = 0.6
time0 = rexp(300, rate=log(2)/12)
time1 = rexp(300, rate=log(2)/12*0.6)
time = c(time0, time1)
cnsr = rep(0, 600)
treatment = c(rep("control", 300), rep("experiment", 300))
s = sample(1:600)
data = data.frame(cbind(time, cnsr))
data$treatment = treatment
data = data[s,]
scanfreq0 = scanfreq1 = c(rep(6, 2), rep(9, 100))*7/(365.25/12)
km<-survival::survfit(survival::Surv(time, 1-cnsr)~treatment, data=data)
plot(km,xlab="Month Since Randomization",ylab="Survival",
main="True unobservable PFS", lty=1:2,xlim=c(0,36))
data$PFS = pfs_scan(time = data$time, cnsr = data$cnsr,
treatment = data$treatment, scanfreq0 = scanfreq0,
scanfreq1=scanfreq1)
km2<-survival::survfit(survival::Surv(PFS, 1-cnsr)~treatment, data=data)
plot(km2,xlab="Month Since Randomization",ylab="Survival",
main="Observed PFS", lty=1:2,xlim=c(0,36))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.