## ###### ###### Title: Session2Code.q ###### Author: D. Gillen ###### Date: 08.14.2013 (UW Summer Institue in Biostatistics - Group Sequential Methods) ###### Description: Code for Session 2 (Fixed Sample Study Design) ###### ## library( RCTdesign ) ## ##### Sepsis Trial ## ##### Specification of initial design ## binomFixed <- seqDesign( prob.model = "proportions", arms = 2, null.hypothesis = .3, alt.hypothesis = 0.25, ratio = c(1., 1.), nbr.analyses = 1, test.type = "less", power = 0.80, alpha = 0.025 ) binomFixed ## ##### Display boundaries on normalized Z-statistic scale ## seqBoundary( binomFixed, scale="Z" ) ## ##### Evaluation of operating characteristics ## seqInference( binomFixed ) seqPlotPower( binomFixed ) seqOC( binomFixed, theta=seq( -.10,-.05,by=.01) ) ## ##### Re-design trial with 1700 patients (850/arm) ## binomFixed.1700 <- update( binomFixed, sample.size=1700, power="calculate" ) binomFixed.1700 ## ##### Inference on the boundary for re-designed trial ## seqInference( binomFixed.1700 ) ## ##### Determine 80% power point fo re-designed trial ## seqOC( binomFixed.1700, power=.80 ) ## ##### Compare power curve for re-designed trial ## seqPlotPower( binomFixed, binomFixed.1700, dsnLbls=c("N=2495","N=1700") ) seqPlotPower( binomFixed.1700, reference=binomFixed ) ## ##### Sensitivity to baseline event rate ## Fixed.3 <- binomFixed.1700 Fixed.4 <- update( Fixed.3, null.hypothesis=.4, alt.hypothesis=.35 ) Fixed.2 <- update( Fixed.3, null.hypothesis=.2, alt.hypothesis=.15 ) ## ##### Compare power at different baseline event rates ## seqPlotPower( Fixed.3, Fixed.2, Fixed.4, dsnLbls=c("Baseline Rate=.30", "Baseline Rate=.20", "Baseline Rate=.40") ) seqPlotPower( Fixed.2, Fixed.4, reference=Fixed.3, dsnLbls=c("Baseline Rate=.20", "Baseline Rate=.40") ) ## ##### ##### Hodgkin's lymphoma trial ##### ## ##### Specification of inital fixed sample design ## survFixed <- seqDesign( prob.model = "hazard", arms = 2, null.hypothesis = 1., alt.hypothesis = 0.67, ratio = c(1., 1.), nbr.analyses = 1, test.type = "less", power = 0.80, alpha = 0.025 ) survFixed ## ##### Estimation of accrual rate ## seqPHSubjects( survFixed, controlMedian=0.75, accrualTime=3, followupTime=1 ) ## ##### Evaluation of operating characteristics ## seqInference( survFixed ) seqOC(survFixed, theta=seq(.4,1,by=.05) ) seqPlotPower( survFixed, dsnLbls=c("survFixed"), lwd=2 ) ## ##### Determine expected number of events if accrual were restricted to 50/mth ## seqPHSubjects( survFixed, controlMedian = 0.75, accrualTime = 3, followupTime = 1, nEvents = 121 ) ## ##### Re-design trial with 121 maximal events ## survFixed.121 <- update( survFixed, sample.size=121, power="calculate" ) survFixed.121 ## ##### Compare power curve for re-designed trial ## seqPlotPower( survFixed, survFixed.121, lwd=2 ) seqPlotPower( survFixed.121, reference=survFixed.196, lwd=2 )