I_t: Estimated information based on the data In lilywang1988/IAfrac: Tools for weighted log-rank tests

Description

Estimate the information based on the data, which is the numerator of the information fraction.

Usage

 1 2 3 I_t(data_ref, data_check, rho, gamma) I_t.2(data_ref, data_check, rho, gamma) 

Arguments

 data_ref Input reference dataset which provides the survival curves for the estimation. It could be some dataset entirely external to data_check. This dataset should include at lease the 3 variables: survival for the time to event or censoring, delta as the event indicator, and trt for the treatment assignment indicator. It will perfectly fit the output dataset from the data.trim functions. data_check Input dataset to check the estimated information. It should follow the sample format as data_ref, which includes three variables: survival, delta and trt. 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^-))^γ.

Details

The I_t function estimates the information up to the maximum follow-up time in the data of data_check, which is identical to the numerator of the information fraction proposed by Hasegawa (2016): \hat{P}_1(t)\hat{P}_0(t)\int_0^t W(t,s)^2N(t,ds). Note that the datasets data_check and data_ref input here are output data from data.trim functions, or any datasets including survival as time to event or censoring, delta as event indicators, and trt denotes treatment assignment (1 is treatment, 0 is control). Note that I_t.2 is another option which is slightly different from the one proposed in Hasegawa(2016), but is identical to the estimate of variance of the weighted log-rank test, which considers the total at-risk set R(t) and treatment arm R_1(t): \int_0^t\frac{R_1(s)R_0(s)}{R(s)^2}W(t,s)^2N(t,ds).

Value

The returned value is the calculated information estimated from the input dataset data_check using the survival function estimated from data_ref.

Lili Wang

References

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.

data.trim
  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 # 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 #Obtain the full information at the final stage based on the generated data #Trim the data up to the final stage when n_event_FH events have been observed data_temp1 <-data.trim.d(n_event_FH,data_temp)[[1]] I_t(data_temp1,data_temp1,rho,gamma) # the estimated information at the final stage #Trim the data up to certain event numbers at the interim stage when 60% of the events have been observed. Have been trimmed once to get data_temp1, no need to add additional variables, thus set the third argument to be F. I_t.2(data_temp1,data_temp1,rho,gamma) # If we consider the change of the at-risk set, which is not necessary to be a fixed probability. data_temp2 <- data.trim.d(ceiling(0.6*n_event_FH),data_temp1,F)[[1]] I_t(data_temp1,data_temp2,rho,gamma) # Use the full dataset data_temp to provide the survival function, and check the estimated information for the trimmed data set data_temp2 with only 60% of the planned events have been observed. I_t.2(data_temp1,data_temp2,rho,gamma) # If we consider the change of the at-risk set, which is not necessary to be a fixed probability.