#The forward-looking Gittins Index rule with delayed responses follow a normal
#distribution with a mean of 30 days and a standard deviation of 3 days
#One can run the following command 20000 times to obtain the selected cut-off
#value around -2.1725 with an overall lower one-sided type I error 0.025
# \donttest{
stopbound1<-lapply(1:20000,function(x){
flgi_cut_off_known_var(Gittinstype='KV',df=0.995,Pats=10,nMax=50000,
TimeToOutcome=expression(rnorm( length( vStartTime ),30, 3)),enrollrate=0.5,
K=3,noRuns2=100,Tsize=852,block=20,rule='FLGI PM',prior_n=rep(1,3),
prior_mean=rep(9/100,3),mean=c(9.1/100,9.1/100,9.1/100),sd=c(0.009,0.009,0.009),
side='lower')})
stopbound1a<-do.call(rbind,stopbound1)
sum(stopbound1a<(-2.1725) )/20000
#The selected cut-off value is around -2.1725 with an overall lower one-sided
#type I error of 0.025, based on 20000 simulations.
# }
#One can run the following command 20000 times to obtain the selected cut-off
#value around -2.075 with an overall lower one-sided type I error 0.025
# \donttest{
stopbound1<-lapply(1:20000,function(x){
flgi_cut_off_known_var(Gittinstype='KV',df=0.995,Pats=10,nMax=50000,
TimeToOutcome=expression(rnorm( length( vStartTime ),30, 3)),enrollrate=0.1,
K=3,noRuns2=100,Tsize=852,block=20,rule='CFLGI',prior_n=rep(1,3),
prior_mean=rep(9/100,3),mean=c(9.1/100,9.1/100,9.1/100),sd=c(0.009,0.009,0.009),
side='lower')})
stopbound1a<-do.call(rbind,stopbound1)
sum(stopbound1a<(-2.075) )/20000
#The selected cut-off value is around -2.075 with an overall lower one-sided type I
#error of 0.025, based on 20000 simulations.
# }
Run the code above in your browser using DataLab