# NOT RUN {
pT=plan.GST(K=3,SF=4,phi=-4,alpha=0.05,delta=6,pow=0.9,compute.alab=TRUE,compute.als=TRUE)
iD=list(T=1, z=1.090728)
swImax=0.0625
I2min=3*swImax
I2max=3*swImax
sT=adapt(pT=pT,iD=iD,SF=1,phi=0,cp=0.8,theta=5,I2min,I2max,swImax)
sTo=list(T=2, z=2.393)
AGST<-as.AGST(pT=pT,iD=iD,sT=sT,sTo=sTo)
AGST
plot(AGST)
AGST<-summary(AGST)
plot(AGST)
##The repeated confidence interval and p-value at an earlier stage
##than the one where the trial stops (T=3).
summary(as.AGST(pT,iD,sT,sTo=list(T=1,z=1.7)),ctype="r",ptype="r")
##If the stage-wise adjusted confidence interval is calculated at this stage,
##the function returns an error message
summary(as.AGST(pT,iD,sT,sTo=list(T=1,z=1.7)),ctype="so",ptype="so")
# }
Run the code above in your browser using DataLab