Description Usage Arguments Details Value Author(s) References See Also Examples
Monitor the raction for Fleming-Harrington weighted log-rank test for a vector of time points
1 | FH.frac.cal(data, t_vec, I_max, rho, gamma, trimmed)
|
data |
There are two possible structures allowed for this input data. The first type needs to have |
t_vec |
Follow-up time since the origin of the study (not that it's not following the survival time scale, but following the calendar time scale ), which could be a vector, to measure the information fraction for these time points. |
I_max |
The evaluated I_{max}, which returned from function |
rho |
First power parameter for the Fleming-Harrington weight which weighs on the early departures: S(t^-)^ρ(1-S(t^-))^γ. |
gamma |
Second power parameter for the Fleming-Harrington weight which weighs on the late departures: S(t^-)^ρ(1-S(t^-))^γ. |
trimmed |
Logical indicator to show whether the |
Calculation the information fraction for Fleming-Harrington family weighted log-rank tests using the monitored estimated information for numerator, and the predicted information I_{max} as denominator.
This function returns a vector of information fractions corresponding to the input time vector t_vec
.
Lili Wang
Hasegawa, T. (2016). Group sequential monitoring based on the weighted log‐rank test statistic with the Fleming–Harrington class of weights in cancer vaccine studies. Pharmaceutical statistics, 15(5), 412-419.
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 | # install.packages("devtools")
# library(devtools)
# install_github("keaven/nphsim")
library(nphsim)
eps<-2 # delayed effect
p<-0.5 #treatment assignment
b<-30 # an intrinsic parameter to decide the number of intervals per time unit
tau<- 18 # end of the study
R<-14 # accrual period [0,R]
omega<- tau-R
lambda<-log(2)/6 # control group risk hazard
theta<-0.7 # hazard ratio
lambda.trt<- lambda*theta #hazard after the change point for the treatment arm
rho<- 0 # parameter for the weights
gamma<-1 #parameter for the weights
alpha<-0.025 #type 1 error
beta<-0.1 #type 2 error
# First we decide the sample size:
size_FH <- sample.size_FH(eps,p,b,tau,omega,lambda,lambda.trt,rho, gamma,alpha,beta)
n_FH <-size_FH$n
n_event_FH<-size_FH$n_event
accrual.rt<-n_FH/R # the needed arrual rate
#Generate data accordingly, use eta=1e-5 to inhibit censoring
data_temp <- nphsim(nsim=1,lambdaC=lambda, lambdaE = c(lambda,lambda.trt),
ssC=ceiling(n_FH*(1-p)),intervals = c(eps),ssE=ceiling(n_FH*p),
gamma=accrual.rt, R=R, eta=1e-5, fixEnrollTime = TRUE)$simd
# Example 1 for FH.frac.cal: Set trimmed=F and work on the crude dataset from nphsim()
inf_frac_vec1<-FH.frac.cal(data_temp,c(10,15,18),I_denom,rho,gamma,trimmed=F)
inf_frac_vec1
# Example 2 for FH.frac.cal: First trim the data before inputting into FH.frac.cal() setting trimmed=T, and obtain the whole spectrum.
I_denom<-I.1(rho, gamma,lambda,theta,eps,R,p,t.star=tau)*n_FH
tau.star=21 #in case the ratio=1 when t>tau
#Trim the data
data_temp2 <-data.trim(tau.star,data_temp)
t_seq <- seq(0.1,tau.star,0.1) # the time series to check the information fraction
inf_frac_vec2<-FH.frac.cal(data_temp2,t_seq,I_denom,rho,gamma,trimmed=T)
# WLRT at the interim
interim_index<- which.min(abs(inf_frac_vec2-0.6))
interim_time<-t_seq[interim_index]
interim_frac<-inf_frac_vec2[interim_index]
# WLRT at the final
final_index<- which.min(abs(inf_frac_vec2-1))
final_time<-t_seq[final_index]
final_frac<-inf_frac_vec2[final_index]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.