View source: R/implementation_functions.R
| gsearlyModel | R Documentation |
Provides sample sizes and power for group sequential designs with early outcomes defined by a recruitment and correlation model, recruitment period and interim analysis time-points.
gsearlyModel(rmodel="fix", trecruit, s, tfu, tinterims, pow=0.9, n=NULL,
theta, tref=c(1,2), contrat=c(1,2), roundup=TRUE, m=2, cmodel="uniform",
sd=1, rho=0.5, fp, tn, treatnames=c("control", "treat"),
sopt=list(r=18, bisect=list(min=20, max=10000, niter=1000, tol=0.001)))
rmodel |
Recruitment model, options are c( |
trecruit |
The recruitment period (an integer >1) which is used to define
the base units for all analyses and plotting functions (which are on a scale
of |
s |
The study outcome is observed at a sequence of |
tfu |
A vector of length |
tinterims |
A vector of ordered numeric interim analysis time-points, in
the same units as |
pow |
The study target power. If |
n |
The total study sample size (control + treatment groups). If this is
set to |
theta |
The treatment effect, in the same units as |
tref |
A vector of integers of length 2 that defines the correlation
parameter |
contrat |
A vector of length 2 of integers, with the relative sizes of
the control and control + treatment group numbers, where the first element
takes a value >= 1; default |
roundup |
Logical to round up the sample size to a multiple of
|
m |
A parameter (1 <= |
cmodel |
The correlation model is set to either |
sd |
The standard deviation (0 < |
rho |
The correlation parameter (0 <= |
fp |
A vector (of length |
tn |
A vector (of length |
treatnames |
Names used for the two study groups, referred to elsewhere
as the first (or 0) and second (or 1) groups, with default
|
sopt |
List of settings for the |
An object of class gsearly is a list containing the following components.
title |
Package title and version number. |
call |
Call to |
rdata |
A list of the recruitment model ( |
idata |
A list of the correlation model ( |
power |
A list of the total number of the looks ( |
expectSampsize, fixedSampsize,
roundInterims, corrExp, corrUnif
# 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, contrat=c(1,2), 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$intnumbers
# Information at these interims and final analysis
rctdesign$idata$inform
# Upper and lower stopping boundaries and probabilities
rctdesign$power$lowerror
rctdesign$power$upperror
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.