pwepowerfindt: Calculating the timepoint where a certain power of the... In PWEALL: Design and Monitoring of Survival Trials Accounting for Complex Situations

Description

This will calculate the timepoint where a certain power of the specified test statistics is obtained accouting for staggered entry, delayed treatment effect, treatment crossover and loss to follow-up.

Usage

 1 2 3 4 5 6 7 8 9 10 pwepowerfindt(power=0.9,alpha=0.05,twosided=1,tupp=5,tlow=1,taur=1.2, u=c(1/taur,1/taur),ut=c(taur/2,taur),pi1=0.5, rate11=c(1,0.5),rate21=rate11,rate31=c(0.7,0.4), rate41=rate21,rate51=rate21,ratec1=c(0.5,0.6), rate10=rate11,rate20=rate10,rate30=rate31, rate40=rate20,rate50=rate20,ratec0=c(0.6,0.5), tchange=c(0,1),type1=1,type0=1, rp21=0.5,rp20=0.5,eps=1.0e-2,veps=1.0e-2, epsbeta=1.0e-04,iterbeta=25, n=1000,testtype=1,maxiter=20,itereps=0.001)

Arguments

 power the desired power alpha type-1 error twosided twoside test or not tupp an upper time point where the power should be larger than power tlow a lower time point where the power should be smaller than power 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 rate11, rate21, rate31, etc. 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 error tolerence veps error tolenrence for calculating variance epsbeta error tolerance for calculating overall log HR iterbeta maximum number of iterations for calculating overall log HR n total number of subjects testtype test statistics, =1 log-rank;=2 Cox model; =3 log-rank with robust variance maxiter maximum number of bi-section iterations itereps error tolerance of power

Details

The hazard functions corresponding to rate11,...,rate51,ratec1, rate10,...,rate50,ratec0 are all piecewise constant function taking the form λ(t)=∑_{j=1}^m λ_j I(t_{j-1}≤ t<t_j), where λ_1,…,λ_m are the corresponding elements of the rates and t_0,…,t_{m-1} are the corresponding elements of tchange, t_m=∞. Note that all the rates must have the same tchange.

Value

 testtype type of statistic, =1 log-rank;=2 Cox model; =3 log-rank with robust variance time time calculated when the iterations stop power the power at time err distance from the desired power k number of bi-section iterations performed

Note

Version 1.0 (7/19/2016)

Xiaodong Luo

References

Luo, et al. (2017)