plotPowerTri {CoRpower}R Documentation

Plotting of Power versus Correlate of Risk Effect Size for Dichotomous and Trichotomous Biomarkers

Description

Plots power (on the y-axis) to detect a correlate of risk effect size (on the x-axis) in the active treatment group for a dichotomous or trichotomous biomarker. The correlate of risk effect size is quantified as the relative risk of the clinical endpoint comparing subgroups of active treatment recipients with high and low biomarker response.

Usage

plotPowerTri(
  outComputePower,
  outDir = NULL,
  legendText,
  legendTitle = NULL,
  extendedLeg = TRUE,
  verboseLeg = TRUE,
  margin = c(11, 7, 3, 1)
)

Arguments

outComputePower

either a list of lists containing output from computePower or a character vector specifying the .RData file(s) containing computePower output

outDir

a character vector specifying path(s) to output .RData file(s), necessary if outComputePower is a character vector. Default is NULL.

legendText

a character vector specifying the entirety of the legend text. The order of the elements (i.e., parameter values) must match that of the computePower input parameters in order for legend labels to be accurate.

legendTitle

a character vector specifying the legend title if applicable (NULL by default)

extendedLeg

a logical value specifying if the extended footnote legend with additional information about the control-to-case ratio, overall vaccine efficacy, number of cases, etc., is to be included. Default is TRUE.

verboseLeg

a logical value specifying if the extended footnote legend shall use English words (TRUE by default) or mathematical notation used in Gilbert, Janes, and Huang (2016)

margin

a numeric vector of the form c(bottom, left, top, right), which specifies the margins of the plot. Default is c(11, 7, 3, 1).

Details

If multiple levels are specified for the biomarker measurement error input parameters (i.e., for sens/spec or rho) in computePower, only the first level is used to determine the RR_t values shown as x-axis tickmark labels.

Value

None. The function is called solely for plot generation.

References

Gilbert P. B., Janes H., and Huang Y. (2016), Power/Sample Size Calculations for Assessing Correlates of Risk in Clinical Efficacy Trials. Stat Med 35(21):3745-59.

See Also

computePower, plotPowerCont

Examples

# Example scenario with trichotomous biomarker, where values of controlCaseRatio are varied

# Set input parameters for computePower function
nCasesTx <- 10
nControlsTx <- 300
nCasesTxWithS <- 10
controlCaseRatio <- c(5,3)
VEoverall <- 0.75
risk0 <- 0.034
VElat0 <- seq(0, VEoverall, len=5)
VElat1 <- rep(VEoverall, 5)
Plat0 <- P0 <- 0.2
Plat2 <- P2 <- 0.6
sens <- spec <- 0.8
FP0 <- FN2 <- 0
M <- 50
alpha <- 0.05
biomType <- "trichotomous"

# Output from computePower function is stored in an object as a list of lists
pwr <- computePower(nCasesTx=nCasesTx, nControlsTx=nControlsTx, nCasesTxWithS=nCasesTxWithS,
                     controlCaseRatio=controlCaseRatio, risk0=risk0,
                     VEoverall=VEoverall, Plat0=Plat0, Plat2=Plat2, P0=P0, P2=P2,
                     VElat0=VElat0, VElat1=VElat1, M=M, alpha=alpha, spec=spec,
                     FP0=FP0, sens=sens, FN2=FN2, biomType=biomType)

# Set parameters for plotPowerTri function
# outComputePower is a list of lists containing outputs from the computePower function
outComputePower <- pwr
legendText <- paste0("controls:cases = ", c("5:1","3:1"))
plotPowerTri(outComputePower=outComputePower, legendText=legendText)

## Not run: 
# outComputePower is a character vector specifying the files containing computePower output
# outDir is a character vector specifying the outComputePower file directories
outComputePower <- paste0("myFile_controlCaseRatio_", c(5, 3), ".RData")
outDir <- rep("~/myDir", 2)
legendText <- paste0("controls:cases = ", c("5:1","3:1"))
plotPowerTri(outComputePower, outDir=outDir, legendText = legendText)

## End(Not run)


[Package CoRpower version 1.0.4 Index]