plotRCDF.byArm: Plot Characteristics of the Estimated Distribution of the...

Description Usage Arguments Value See Also Examples

Description

Takes the output from the completeTrial.byArm function and generates a plot describing characteristics of the estimated distribution of the treatment arm-specific number of endpoints.

Usage

1
2
3
plotRCDF.byArm(armLabel, trtNames, eventTimeFrame = NULL,
  eventPPcohort = FALSE, eventPriorRate, eventPriorWeight, xlim = NULL,
  xlab = NULL, ylab = NULL, fileDir)

Arguments

armLabel

a character string matching a treatment label in the arm variable in interimData that indicates the treatment arm for which the plot will be generated

trtNames

a character vector of all treatment labels listed in the same order as in trtNames in completeTrial.byArm

eventTimeFrame

a time frame within which endpoints are counted, specified in weeks as c(start, end). If NULL (default), then all endpoints are counted.

eventPPcohort

a logical value. If TRUE, only endpoints in the per-protocol cohort are counted. The default value is FALSE.

eventPriorRate

a numeric vector of treatment arm-specific prior mean incidence rates for the endpoint, expressed as numbers of events per person-year at risk, matching the order of treatment arms in trtNames

eventPriorWeight

a numeric vector in which each value represents a weight (i.e., a separate scenario) assigned to the prior gamma distribution of the treatment arm-specific event rate at the time when 50% of the estimated person-time at risk in the given arm has been accumulated

xlim

a numeric vector of the form c(xmin, xmax) for the user-specified x-axis limits. If NULL (default), then the computed range of x-axis values will be used.

xlab

a character string for the user-specified x-axis label. If NULL (default), then the label "Number of Infections in Group armLabel (n)" will be used.

ylab

a character string for the user-specified y-axis label. If NULL (default), then the label "P(Number of Infections in Group armLabel >= n ) x 100" will be used.

fileDir

a character string specifying a path for the input directory

Value

None. The function is called solely for plot generation.

See Also

completeTrial.byArm and plotRCDF.pooledArms

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
arm <- rep(c("C3","T1","T2"), each=250)
schedule <- rbinom(length(arm), 1, 0.01)
entry <- rpois(length(arm), lambda=60)
entry <- entry - min(entry)
last_visit_dt <- entry + runif(length(arm), min=0, max=80)
event <- rbinom(length(arm), 1, 0.01)
dropout <- rbinom(length(arm), 1, 0.02)
dropout[event==1] <- 0
exit <- rep(NA, length(arm))
exit[event==1] <- last_visit_dt[event==1] + 5
exit[dropout==1] <- last_visit_dt[dropout==1] + 5
followup <- ifelse(event==1 | dropout==1, 0, 1)
interimData <- data.frame(arm=arm, schedule2=schedule, entry=entry, exit=exit,
last_visit_dt=last_visit_dt, event=event, dropout=dropout, complete=0, followup=followup)

weights <- c(0.2, 0.4, 0.6)
for (j in 1:length(weights)){
  completeTrial.byArm(interimData=interimData, nTrials=50,
  trtNames=c("C3","T1","T2"),N=c(500,500,500),
  enrollRatePeriod=24, eventPriorWeight=weights[j], eventPriorRate=c(0.06,0.03,0.03),
  fuTime=80, visitSchedule=seq(0, 80, by=4), visitSchedule2=c(0,seq(from=8,to=80,by=12)),
  saveDir="./", randomSeed=9)
}

pdf(file=paste0("./","rcdf_byArm_arm=T1_",
"eventPriorRateC3=0.06_eventPriorRateT1=0.03_eventPriorRateT2=0.03.pdf"), width=6,
height=5)
plotRCDF.byArm(armLabel="T1", trtNames=c("C3","T1","T2"), eventPriorRate=c(0.06,0.03,0.03),
eventPriorWeight=weights, fileDir="./")
dev.off()

futility documentation built on May 1, 2019, 10:13 p.m.