Description Usage Arguments Details Value Examples
View source: R/simulation.mcr.pfs.R
Consider the survival function of mixture cure rate (MCR) distribution:
S(t) = p + (1-p)S0(t)
, where S0(t)
is a survival distribution
for susceptible subject, i.e., S0(0)=1 and S0(t) -> 0 as t -> Infinity.
S0(t) can be any proper survival function. For generality of S0(t), consider
the generalized modified Weibull (GMW) distribution with parameters
(alpha, beta, gamma, lambda) Martinez et al(2013).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | simulation.mcr.pfs(
nSim = 100,
N = 600,
A = 18,
w = 1.5,
r = 1,
p = c(0.1, 0.1),
alpha = c(log(2)/12, log(2)/12),
beta = c(1, 1),
gamma = c(1, 1),
lambda = c(0, 0),
tau = c(0, 0),
psi = c(1, 1),
drop = c(0, 0),
targetEvents = c(300, 420),
DCO = NULL,
scanfreq0 = c(rep(6, 2), rep(9, 100)) * 7/(365.25/12),
scanfreq1 = c(rep(6, 2), rep(9, 100)) * 7/(365.25/12)
)
|
nSim |
Number of trials |
N |
Total number patients in two arms. |
A |
Total accrual period in months. |
w |
Weight parameter in cumulative enrollment pattern. The cumulative enrollment at month t is (t / A)^w, eg, at month 6, the enrollment is N*(6/24)^2 = N/16 for 24 months planned accrual period. |
r |
Randomization ratio |
p |
Cure rate parameter. When p = 0, it reduces to |
alpha |
Generalized modified Weibull (GMW) distribution parameters. |
beta |
Generalized modified Weibull (GMW) distribution parameters. |
gamma |
Generalized modified Weibull (GMW) distribution parameters. |
lambda |
Generalized modified Weibull (GMW) distribution parameters. |
tau |
Threshold for delayed effect period. |
psi |
Hazard ratio after delayed effect. |
drop |
Drop-off rate per unit time. For example, if 3% drop off in 1 year of followup, then |
targetEvents |
A vector of target events is used to determine DCOs. For example, 397 target events are used to determine IA DCO; and 496 events are used to determine the FA cutoff. |
DCO |
A vector of data cut-off time in months, calculated from first subject in. Default NULL. The date cut-off times will be determined by targetEvents. If provided, then the targetEvents will be ignored. |
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. Applicable for PFS data. |
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. Applicable for PFS data. |
alpha: scale parameter beta and gamma: shape parameters lambda: acceleration parameter
S0(t) = 1-(1-exp(-alphat^gammaexp(lambda*t)))^beta
Special cases: (1) Weibull dist: lambda = 0, beta = 1. Beware of the parameterization difference. (2) Exponential dist: lambda = 0, beta = 1, gamma = 1. The shape parameter (hazard rate) is alpha. (3) Rayleigh dist: lambda = 0, beta = 1, gamma = 2. (4) Exponentiated Weibull dist (EW): lambda = 0 (5) Exponentiated exponential dist (EE): lambda = 0 and gamma = 1 (6) Generalized Rayleigh dist (GR): lambda = 0, gamma = 2 (7) Modified Weibull dist (MW): beta = 1
Let T be the survival time according to survival function S1(t) below.
Denote T's distribution as MCR(p, alpha, beta, gamma, lambda, tau, psi),
where tau is the delayed effect and psi is the hazard ratio after delayed effect,
ie. proportional hazards to S(t) after delay tau.
S(t) = p + (1-p)*S0(t)
S1(t) = S(t)I(t<tau) + S(tau)^(1-psi)*S(t)^psi
In brief, S0(t)
is the proper GMW distribution (alpha, beta, gamma, lambda)
;
S(t)
is MCR with additional cure rate parameter p
;
In reference to S(t)
, S1(t)
is a delayed effect distribution and proportional hazards after delay.
A dataframe for each analysis including the following variables:
sequence number of simulated dataset;
treatment group with values of "control" and "experimental"
Time of randomization in calendar time
the time when event/censoring occurred in calendar time
Survival time for analysis, = calendarTime - enterTime
censor status (0=event; 1=censor) before administrative censoring due to data cut
Data CutOff Time (DCO);
Survival time after cut
Censor status after cut
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #Example. Delayed effect 6 months, proportional hazards HR = 0.6
#Total 600 pts, 1:1 randomization, control median OS 12 mo;
#HR = 0.65, enrollment 24 months, weight 1.5, no drop offs;
#IA and FA are performed at 400 and 500 events respectively.
set.seed(2022)
data = simulation.mcr.pfs(nSim=1, N = 600, A = 18, w=1.5, r=1, p=c(0.1,0.1),
alpha = c(log(2)/12,log(2)/12), beta=c(1,1), gamma=c(1,1),
lambda=c(0,0), tau=c(0,6), psi=c(1,0.6), drop=c(0,0),
targetEvents = c(350, 500), DCO = NULL, scanfreq0=c(rep(6, 2), rep(9, 100))*7/(365.25/12),
scanfreq1=c(rep(6, 2), rep(9, 100))*7/(365.25/12))
data.IA = data[[1]][data[[1]]$sim==1,]
data.FA = data[[2]][data[[2]]$sim==1,]
m0 = qmcr(0.5, p=0.1, alpha = log(2)/12, beta=1, gamma=1, lambda=0, tau=0, psi=1)
m1 = qmcr(0.5, p=0.1, alpha = log(2)/12, beta=1, gamma=1, lambda=0, tau=6, psi=0.6)
km.IA<-survival::survfit(survival::Surv(survTimeCut,1-as.numeric(cnsrCut))~treatment, data=data.IA)
plot(km.IA, ylab="Survival", xlim=range(km.FA$time))
abline(h = c(0.1, 0.5), col="gray80", lty=2)
abline(v=c(6, m1, m0), col="gray80", lty=2)
km.FA<-survival::survfit(survival::Surv(survTimeCut,1-as.numeric(cnsrCut))~treatment, data=data.FA)
plot(km.FA, ylab="Survival", xlim=range(km.FA$time))
abline(h = c(0.1, 0.5), col="gray80", lty=2)
abline(v=c(6, m1, m0), col="gray80", lty=2)
#No consideration of scan intervals
set.seed(2022)
data0 = simulation.mcr.pfs(nSim=1, N = 600, A = 18, w=1.5, r=1, p=c(0.1,0.1),
alpha = c(log(2)/12,log(2)/12), beta=c(1,1), gamma=c(1,1),
lambda=c(0,0), tau=c(0,6), psi=c(1,0.6), drop=c(0,0),
targetEvents = c(350, 500), DCO = NULL, scanfreq0=NULL,
scanfreq1=NULL)
data0.IA = data0[[1]][data0[[1]]$sim==1,]
data0.FA = data0[[2]][data0[[2]]$sim==1,]
m0 = qmcr(0.5, p=0.1, alpha = log(2)/12, beta=1, gamma=1, lambda=0, tau=0, psi=1)
m1 = qmcr(0.5, p=0.1, alpha = log(2)/12, beta=1, gamma=1, lambda=0, tau=6, psi=0.6)
km.IA0<-survival::survfit(survival::Surv(survTimeCut,1-as.numeric(cnsrCut))~treatment, data=data0.IA)
km.FA0<-survival::survfit(survival::Surv(survTimeCut,1-as.numeric(cnsrCut))~treatment, data=data0.FA)
plot(km.IA0, ylab="Survival", xlim=range(km.FA0$time))
abline(h = c(0.1, 0.5), col="gray80", lty=2)
abline(v=c(6, m1, m0), col="gray80", lty=2)
plot(km.FA0, ylab="Survival", xlim=range(km.FA0$time))
abline(h = c(0.1, 0.5), col="gray80", lty=2)
abline(v=c(6, m1, m0), col="gray80", lty=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.