Learn R Programming

gsearly (version 1.0.0)

gsearlyUser: User input estimates of sample size and power for group sequential designs with early outcomes

Description

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.

Usage

gsearlyUser(trecruit, s, tfu, tinterims, ninterims, pow=0.9, n=NULL,
       tref=c(1,2), vphi=0.5, 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)))

Value

An object of class gsearly is a list containing the following components

title

Package title and version number.

call

Call to gsearlyUser.

rdata

A list of same structure as for gsearlyModel with the recruitment model set to "none", the recruitment model parameter (m) set to NA and the numbers of study participants recruited and with outcome data at each of the interims set to ninterims.

idata

A list of same structure as for gsearlyModel with the correlation model type (cmodel$type) set to "none" and the parameter (cmodel$rho) set to NA, if either "uniform" or "exponential" are not selected.

power

A list of same structure as for gsearlyModel. In addition for designs based on fixed numbers of participants at interim, where n is unset, the minimum and maximum attainable power (rangepow).

Arguments

trecruit

As for gsearlyModel.

s

As for gsearlyModel.

tfu

As for gsearlyModel.

tinterims

As for gsearlyModel.

ninterims

A matrix with s + 1 columns and length(interims) rows giving the numbers of participants providing data or present at each interim analysis (row) at recruitment (first column) and at each follow-up time point (tfu) in columns 2 to s + 1. Alternatively, a function fn(x) that gives a matrix of these dimensions for sample sizes x in the range (sopt$bisect$min, sopt$bisect$max). Currently this is only implemented and tested for functions based on fixed proportions.

pow

As for gsearlyModel.

n

As for gsearlyModel.

tref

As for gsearlyModel.

vphi

As for gsearlyModel.

cmodel

Either a correlation model, c("uniform", "exponential"), defined by correlation parameter rho, or a user supplied correlation matrix of dimensions s x s.

sd

As for gsearlyModel.

rho

As for gsearlyModel if cmodel is set to "uniform" or "exponential", otherwise ignored.

theta

As for gsearlyModel.

fp

As for gsearlyModel.

tn

As for gsearlyModel.

treatnames

As for gsearlyModel.

sopt

As for gsearlyModel.

See Also

gsearlyModel

Examples

Run this code

 # 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, vphi=0.5, 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$interims
 cmodel <- modeldesign$idata$cmodel$corrmat
 userdesign <- gsearlyUser(trecruit=36, s=3, tfu=c(3,6,12), tinterims=c(18,30),
        ninterims=ninterims, n=n, vphi=0.5, cmodel=cmodel,
        sd=20, theta=8, fp=fp, tn=tn)
 userdesign

 # Expected numbers of participants at interim analyses
 modeldesign$rdata$interims
 userdesign$rdata$interims

 # Information at these interims and final analysis
 modeldesign$idata$interims
 userdesign$idata$interims

 # 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, vphi=0.5, pow=0.9, cmodel=cmodel,
        sd=20, theta=8, fp=fp, tn=tn)
 nuserdesign

Run the code above in your browser using DataLab