crossBoundCumProb: Estimate cumulative probabilities of crossing an efficacy or...

View source: R/postMonitoring.R

crossBoundCumProbR Documentation

Estimate cumulative probabilities of crossing an efficacy or non-efficacy boundary in an event-driven 2-arm trial design

Description

Computes proportions of simulated trials that crossed either an efficacy or a non-efficacy stopping boundary by analysis 1,…,\code{nAnalyses} using an .RData output file from monitorTrial. An event-driven 2-arm trial design is assumed.

Usage

crossBoundCumProb(
  boundType = c("eff", "nonEff"),
  nAnalyses,
  monitorTrialFile,
  monitorTrialDir = NULL
)

Arguments

boundType

a character string specifying if the one-sided null hypothesis is of the form H_0: θ ≥q θ_0 ("eff", default) or H_0: θ ≤q θ_0 ("nonEff"), where θ and θ_0 are the true hazard ratio and its value specifying the null hypothesis, respectively

nAnalyses

a numeric value specifying the number of analyses

monitorTrialFile

either a character string specifying an .RData file or a list outputted by monitorTrial

monitorTrialDir

a character string specifying a path to monitorTrialFile if monitorTrialFile specifies a file name

Value

A numeric vector of estimated cumulative probabilities of crossing the specified boundary by analysis 1,…,\code{nAnalyses}.

Examples

simData <- simTrial(N=c(1000, 1000), aveVE=c(0, 0.4),
                    VEmodel="half", vePeriods=c(1, 27, 79), enrollPeriod=78,
                    enrollPartial=13, enrollPartialRelRate=0.5, dropoutRate=0.05,
                    infecRate=0.06, fuTime=156, visitSchedule=seq(0, 156, by=4),
                    missVaccProb=0.05, VEcutoffWeek=26, nTrials=5,
                    stage1=78, randomSeed=300)

monitorData <- monitorTrial(dataFile=simData, stage1=78, stage2=156,
                            harmMonitorRange=c(10,75), harmMonitorAlpha=0.05,
                            effCohort=list(timingCohort=list(lagTime=0),
                                           times=c(75, 150),
                                           timeUnit="counts",
                                           lagTime=0,
                                           estimand="cox",
                                           nullVE=0,
                                           nominalAlphas=c(0.001525, 0.024501)),
                            nonEffCohorts=list(timingCohort=list(lagTime=0),
                                               times=c(75, 150),
                                               timeUnit="counts",
                                               cohort1=list(lagTime=0,
                                                            estimand="cox",
                                                            nullVE=0.4,
                                                            nominalAlphas=c(0.001525, 0.024501))),
                            lowerVEnoneff=0, highVE=1, lowerVEuncPower=0,
                            alphaHigh=0.05, alphaUncPower=0.05,
                            verbose=FALSE)

crossBoundCumProb(boundType="eff", nAnalyses=2, monitorTrialFile=monitorData)
crossBoundCumProb(boundType="nonEff", nAnalyses=2, monitorTrialFile=monitorData)


mjuraska/seqDesign documentation built on Dec. 14, 2022, 4:26 p.m.