View source: R/implementation_functions.R
| gsearlyUser | R Documentation |
Provides sample sizes and power for group sequential designs with early outcomes defined by a matrix of fixed numbers of participants with data for all outcomes (early and primary) at each interim time-point or a function that gives a similarly structured matrix for all sample sizes in a pre-set range and a correlation model or correlation matrix, recruitment period and interim analysis time-points.
gsearlyUser(trecruit, s, tfu, tinterims, ninterims, pow=0.9, n=NULL,
tref=c(1,2), contrat=c(1,2), roundup=TRUE, cmodel="uniform",
sd=1, rho=0.5, theta, fp, tn, treatnames=c("control","treat"),
sopt=list(r=18, bisect=list(min=20, max=10000, niter=1000, tol=0.001)))
trecruit |
As for |
s |
As for |
tfu |
As for |
tinterims |
As for |
ninterims |
A matrix with |
pow |
As for |
n |
As for |
tref |
As for |
contrat |
As for |
roundup |
As for |
cmodel |
Either a correlation model, |
sd |
As for |
rho |
As for |
theta |
As for |
fp |
As for |
tn |
As for |
treatnames |
As for |
sopt |
As for |
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 same structure as for |
idata |
A list of same structure as for |
power |
A list of same structure as for |
gsearlyModel
# For 90 percent power (pow), a call to gsearlyModel provides a feasible design
fp <- c(0.0000,0.0010,0.0250)
tn <- c(0.2400,0.7200,0.9750)
modeldesign <- 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)
modeldesign
# This design can be replicated using gsearlyUser
n <- modeldesign$rdata$n["total"]
ninterims <- modeldesign$rdata$intnumbers
cmodel <- modeldesign$idata$cmodel$corrmat
userdesign <- gsearlyUser(trecruit=36, s=3, tfu=c(3,6,12), tinterims=c(18,30),
ninterims=ninterims, n=n, contrat=c(1,2), cmodel=cmodel,
sd=20, theta=8, fp=fp, tn=tn)
userdesign
# Expected numbers of participants at interim analyses
modeldesign$rdata$intnumbers
userdesign$rdata$intnumbers
# Information at these interims and final analysis
modeldesign$idata$inform
userdesign$idata$inform
# Upper and lower stopping boundaries and probabilities
rbind(modeldesign$power$lowerror, modeldesign$power$upperror)
rbind(userdesign$power$lowerror, userdesign$power$upperror)
# Change correlation matrix and interim numbers
cmodel <- matrix(c(1,0.2,0.1, 0.2,1,0.1, 0.1,0.1,1), nrow=3, byrow=TRUE)
ninterims <- matrix(c(130,110,90,45, 200,175,160,120), nrow=2, byrow=TRUE)
# For 90 percent power (pow), a call to gsearlyUser provides a feasible design
nuserdesign <- gsearlyUser(trecruit=36, s=3, tfu=c(3,6,12), tinterims=c(18,30),
ninterims=ninterims, contrat=c(1,2), pow=0.9, cmodel=cmodel,
sd=20, theta=8, fp=fp, tn=tn)
nuserdesign
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.