plotRCDF.pooledArms {futility} | R Documentation |
Plot Characteristics of the Estimated Distribution of the Treatment Arm-Pooled Number of Endpoints
Description
Takes the output from the completeTrial.pooledArms
function and generates a plot describing characteristics of the estimated distribution of the treatment arm-pooled number of endpoints.
Usage
plotRCDF.pooledArms(eventTimeFrame = NULL, eventPPcohort = FALSE,
target, power.axis = TRUE, power.TE = NULL, eventPriorRate,
eventPriorWeight, xlim = NULL, xlab = NULL, ylab = NULL,
power.lab = NULL, xPosLegend = 0.67, fileDir)
Arguments
eventTimeFrame |
a time frame within which endpoints are counted, specified in weeks as |
eventPPcohort |
a logical value. If |
target |
a vector of target numbers of endpoints for reporting of the estimated probability that the total number of endpoints will be |
power.axis |
a logical value. If |
power.TE |
a numeric value of treatment efficacy for which power is shown on the top axis. If |
eventPriorRate |
a numeric value of the treatment arm-pooled prior mean incidence rate for the endpoint, expressed as the number of events per person-year at risk |
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-pooled event rate at the time when 50% of the estimated total person-time at risk has been accumulated |
xlim |
a numeric vector of the form |
xlab |
a character string for the user-specified x-axis label. If |
ylab |
a character string for the user-specified y-axis label. If |
power.lab |
a character string for the user-specified power-axis label. If |
xPosLegend |
a numeric value in |
fileDir |
a character string specifying a path for the input directory |
Value
None. The function is called solely for plot generation.
See Also
completeTrial.pooledArms
and plotRCDF.byArm
Examples
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.pooledArms(interimData=interimData, nTrials=50, N=1500, enrollRatePeriod=24,
eventPriorWeight=weights[j], eventPriorRate=0.06, 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_pooled_eventPriorRate=",0.06,".pdf"), width=6, height=5)
plotRCDF.pooledArms(target=c(60,30), power.axis=FALSE, eventPriorRate=0.06,
eventPriorWeight=weights, fileDir="./")
dev.off()