pwecxpwufindt {PWEALL} | R Documentation |
calculate the timeline when certain number of events accumulates
Description
This will calculate the timeline from study inception accouting for staggered entry, delayed treatment effect, treatment crossover and loss to follow-up.
Usage
pwecxpwufindt(target=400,ntotal=1000,taur=5,u=c(1/taur,1/taur),ut=c(taur/2,taur),pi1=0.5,
rate11=c(1,0.5),rate21=c(0.8,0.9),rate31=c(0.7,0.4),
rate41=rate21,rate51=rate21,ratec1=c(0.5,0.6),
rate10=c(1,0.7),rate20=c(0.9,0.7),rate30=c(0.4,0.6),
rate40=rate20,rate50=rate20,ratec0=c(0.3,0.3),
tchange=c(0,1),type1=1,type0=1,
rp21=0.5,rp20=0.5,eps=1.0e-2,
init=taur,epsilon=0.000001,maxiter=100)
Arguments
target |
target number of events |
ntotal |
total number of subjects |
taur |
recruitment time |
u |
Piecewise constant recuitment rate |
ut |
Recruitment intervals |
pi1 |
Allocation probability for the treatment group |
rate11 |
Hazard before crossover for the treatment group |
rate21 |
Hazard after crossover for the treatment group |
rate31 |
Hazard for time to crossover for the treatment group |
rate41 |
Hazard after crossover for the treatment group for complex case |
rate51 |
Hazard after crossover for the treatment group for complex case |
ratec1 |
Hazard for time to censoring for the treatment group |
rate10 |
Hazard before crossover for the control group |
rate20 |
Hazard after crossover for the control group |
rate30 |
Hazard for time to crossover for the control group |
rate40 |
Hazard after crossover for the control group for complex case |
rate50 |
Hazard after crossover for the control group for complex case |
ratec0 |
Hazard for time to censoring for the control group |
tchange |
A strictly increasing sequence of time points at which the event rates changes. The first element of tchange must be zero. It must have the same length as |
type1 |
Type of crossover in the treatment group |
type0 |
Type of crossover in the control group |
rp21 |
re-randomization prob in the treatment group |
rp20 |
re-randomization prob in the control group |
eps |
A small number representing the error tolerance when calculating the utility function
with |
init |
initital value of the timeline estimate |
epsilon |
A small number representing the error tolerance when calculating the timeline. |
maxiter |
Maximum number of iterations when calculating the timeline |
Details
The hazard functions corresponding to rate11
,...,rate51
,ratec1
, rate10
,...,rate50
,ratec0
are all piecewise constant function taking the form \lambda(t)=\sum_{j=1}^m \lambda_j I(t_{j-1}\le t<t_j)
, where \lambda_1,\ldots,\lambda_m
are the corresponding elements of the rates and t_0,\ldots,t_{m-1}
are the corresponding elements of tchange, t_m=\infty
. Note that all the rates must have the same tchange
.
Value
t1 |
the calculated timeline |
tvar |
the true variance of the timeline estimator |
eps |
final tolerance |
iter |
Number of iterations performed |
Note
Version 1.0 (7/19/2016)
Author(s)
Xiaodong Luo
References
Luo et al. (2018) Design and monitoring of survival trials in complex scenarios, Statistics in Medicine <doi: https://doi.org/10.1002/sim.7975>.
See Also
Examples
target<-400
ntotal<-2000
taur<-1.2
u<-c(1/taur,1/taur)
ut<-c(taur/2,taur)
r11<-c(1,0.5)
r21<-c(0.5,0.8)
r31<-c(0.7,0.4)
r41<-r51<-r21
rc1<-c(0.5,0.6)
r10<-c(1,0.7)
r20<-c(0.5,1)
r30<-c(0.3,0.4)
r40<-r50<-r20
rc0<-c(0.2,0.4)
gettimeline<-pwecxpwufindt(target=target,ntotal=ntotal,
taur=5,u=c(1/taur,1/taur),ut=c(taur/2,taur),pi1=0.5,
rate11=r11,rate21=r21,rate31=r31,rate41=r41,rate51=r51,ratec1=rc1,
rate10=r10,rate20=r20,rate30=r30,rate40=r40,rate50=r50,ratec0=rc0,
tchange=c(0,1),type1=1,type0=1,eps=1.0e-2,init=taur,epsilon=0.000001,maxiter=100)
gettimeline$t1