# RCT planning:
# Recruitment is expected to take 36 months (trecruit) with three
# follow-up times (s) for outcomes at 3, 6 and 12 months (tfu) and
# interim analyses (tinterims) at 18 and 30 months.
# Study procedures and experience suggest that "dilin" (m=2) is likely
# to be a good approximation to temporal patterns of recruitment and data
# accrual (rmodel). Correlations between outcomes at 3, 6 and 12 are
# assumed to follow a uniform model (cmodel) with parameter (rho) set to 0.5.
# Randomisation to the two study arms will be on a 1:1 basis (vphi=0.5).
# The standard deviation of the final 12m outcome is expected to be 20,
# and the anticipated treatment effect (theta) 8.
# Primary interest for the RCT is in stopping early for futility.
# Therefore the following values for the false positive and true
# negative rates were selected.
# Vectors of cumulative probabilities for crossing boundaries under the
# null hypothesis (of no treatment difference).
fp <- c(0.0000,0.0010,0.0250)
tn <- c(0.2400,0.7200,0.9750)
# For 90 percent power (pow), a call to gsearlyModel provides a feasible design
rctdesign <- gsearlyModel(rmodel="dilin", trecruit=36, s=3, tfu=c(3,6,12),
tinterims=c(18,30), pow=0.9, vphi=0.5, m=2,
cmodel="uniform", sd=20, rho=0.5, theta=8, fp=fp, tn=tn)
rctdesign
# If n is set, rather than pow, then we can explore power for lower n
update(rctdesign, n=136)
# Expected numbers of participants at interim analyses
rctdesign$rdata$interims
# Information at these interims and final analysis
rctdesign$idata$interims
# Upper and lower stopping boundaries and probabilities
rctdesign$power$lowerror
rctdesign$power$upperror
Run the code above in your browser using DataLab