#*********2-arm trial fixed-sample design in standardized scale #*** given variance and alternative, calculate sample size (with 97.5% power): dsgn <- seqDesign(prob.model="proportions",null.hypothesis=c(0.3,0.3),alt.hypothesis=c(0.2,0.3),test.type="less") #*** Use the update() command to rescale the above design to get BinomFixed from the lecture notes: binomFixed <- update(dsgn, alt.hypothesis=c(0.25,0.3),power=0.8) #*** Use the update() command to rescale the above design to get BinomFixed.1700 from the lecture notes: binomFixed.1700 <- update(binomFixed,sample.size=1700,power="calculate") #*** Use the update() to find the alternative with 97.5% power for the BinomFixed.1700 design: dsgn2 <- update(binomFixed.1700,alt.hypothesis="calculate",power=0.975) #*** Explore the difference between binomFixed.1700 and dsgn2: dsgn2a <- update(dsgn2,variance=0.3*0.7) dsgn2b <- update(dsgn2,variance=0.275*(1-0.275)) dsgn2c <- update(dsgn2,variance=0.25*0.75) dsgn2d <- update(dsgn2,variance=(0.25*0.75 + 0.3*0.7)/2)