Learn R Programming

sp23design (version 0.9-1)

exploreSP23Design: Explore a specified design by simulation

Description

Explore a chosen design by generating simulated datasets and storing data from simulations for further analysis

Usage

exploreSP23Design(sp23Design, numberOfSimulations = 25, rngSeed = 12345,
showProgress = TRUE)

Arguments

sp23Design

A design object typically created by the function generateSP23Design

numberOfSimulations

The number of simulations to use, default 25

rngSeed

A seed for the random number generator for reproducibility

showProgress

A flag (default TRUE) to show progress or not

Value

A list of length numberOfSimulations where each entry is a data frame with number of interim looks rows and the following variables in the column.

m0

number on control arm

m1

number on treatment arm

y0

number of responses in control

y1

number of responses in treatment

pi0Hat

estimate of the proportion of responders among control

pi1Hat

estimate of the proportion of responders among treatment

pi0HatH0

estimate of the proportion of responders among control under \(H_0\)

pi1HatH0

estimate of the proportion of responders among control under \(H_0\)

pi0HatH1

estimate of the proportion of responders among control under \(H_1\)

pi1HatH1

estimate of the proportion of responders among control under \(H_1\)

glrRespH0

estimate of the generalized likelihood ratio statistic for response under \(H_0\)

glrRespH1

estimate of the generalized likelihood ratio statistic for response under \(H_1\)

glrSurvH0

estimate of the generalized likelihood ratio statistic for survival under \(H_0\)

glrSurvH1

estimate of the generalized likelihood ratio statistic for survival under \(H_1\)

alphaHat

the estimate of \(\alpha\)

alphaHatH0

the estimate of \(\alpha\) under \(H_0\)

alphaHatH1

the estimate of \(\alpha\) under \(H_1\)

betaHat

the estimate of \(\beta\)

betaHatH0

the estimate of \(\beta\) under \(H_0\)

betaHatH1

the estimate of \(\beta\) under \(H_1\)

gammaHat

the estimate of \(\gamma\)

gammaHatH0

the estimate of \(\gamma\) under \(H_0\)

gammaHatH1

the estimate of \(\gamma\) under \(H_1\)

hazard

the estimate of \(d\)

v

the estimate of \(\Gamma_t\)

rejectH0R

a flag indicating if $H_0^R$ was rejected at the interim look

acceptH0R

a flag indicating if $H_0^R$ was accepted (futility) at the interim look

rejectH0S

a flag indicating if $H_0^S$ was rejected at the interim look

acceptH0S

a flag indicating if $H_0^S$ was accepted (futility) at the interim look

b.metas.Last

the last Haybittle-Peto boundary for the survival end-point, if computed

Details

This function is used while exploring the characteristics of a design. Results are accumulated and can be fed into analysis functions to inform choices.

References

Lai, Tze Leung and Lavori, Philip W. and Shih, Mei-Chiung. Sequential Design of Phase II-III Cancer Trials, Statistics in Medicine, 2011, (submitted).

Examples

Run this code
# NOT RUN {
  trialParameters <- list(minimumNumberOfEvents = 20,
                          minimumIncreaseInV = 0.2,
                          numberRecruitedEachYear = c(80, 120, 160, 160),
                          followupTime = 3,
                          adminCensoringTime = 7,
                          interimLookTime = c(1, 2, 3, 5, 7),
                          type1ErrorForResponse = 0.05,
                          type2ErrorForResponse = 0.01,
                          glrBoundarySidedness = "one", # one sided or two-sided
                          type1Error = 0.05,
                          type2Error = 0.10,
                          epsType1 = 1/3,
                          epsType2 = 1/3)

  ## Case C of table 1 in paper
  caseC.TrueParameters <- list(p0 = 0.3,
                               p1 = 0.6,
                               pdiffHyp=0.3,
                               theta = list(
                                   alpha = 0,
                                   beta = 0,
                                   gamma = 0),
                               baselineLambda = 0.35,
                               etaHyp = 0.25)
  ## Do case C as example
  sp23Design <- generateSP23Design(caseC.TrueParameters, trialParameters)
  trialHistory <- exploreSP23Design(sp23Design, numberOfSimulations=25, rngSeed=2387487)
# }

Run the code above in your browser using DataLab