computePower {CoRpower}R Documentation

Power Calculations for Assessing Intermediate Biomarkers as Correlates of Risk in the Active Treatment Group in Clinical Efficacy Trials, Accounting for Biomarker's Measurement Error and Treatment Efficacy

Description

Performs a power calculation for assessing a univariate dichotomous, trichotomous, or continuous intermediate biomarker response as a correlate of risk in the active treatment group in a clinical efficacy trial, accounting for the biomarker's measurement error and treatment efficacy. The statistical methods are described in [Gilbert, Janes, and Huang (2016). "Power/Sample Size Calculations for Assessing Correlates of Risk in Clinical Efficacy Trials."] Simulated data sets, extended to include placebo group and baseline immunogenicity predictor data, can be exported for harmonized assessment of biomarker-specific treatment efficacy.

Usage

computePower(
  nCasesTx,
  nControlsTx,
  nCasesTxWithS,
  controlCaseRatio = NULL,
  VEoverall,
  risk0,
  VElat0 = seq(0, VEoverall, len = 20),
  VElat1 = rep(VEoverall, 20),
  VElowest = NULL,
  Plat0 = NULL,
  Plat2 = NULL,
  P0 = Plat0,
  P2 = Plat2,
  PlatVElowest = NULL,
  sens = NULL,
  spec = NULL,
  FP0 = NULL,
  FN2 = NULL,
  M = 100,
  alpha = 0.05,
  sigma2obs = 1,
  rho = 1,
  biomType = c("continuous", "trichotomous", "dichotomous"),
  cohort = FALSE,
  p = NULL,
  tpsMethod = c("PL", "ML", "WL"),
  saveDir = NULL,
  saveFile = "CoRpower.RData",
  saveDataDir = NULL,
  saveDataFile = "fullData.RData",
  corr = NULL,
  nCasesPla = NULL,
  nControlsPla = NULL,
  sensBIP = NULL,
  specBIP = NULL,
  FP0BIP = NULL,
  FN2BIP = NULL,
  P0BIP = P0,
  P2BIP = P2
)

Arguments

nCasesTx

an integer vector specifying the observed (for a finished trial) or expected (for a trial in design stage) number of clinical endpoint cases between τ and τ_{max} in the active treatment group. Each value represents a distinct scenario for power assessment.

nControlsTx

an integer vector specifying the observed (for a finished trial) or expected (for a trial in design stage) number of controls with completed follow-up through τ_{max} and endpoint-free at τ_{max} in the active treatment group. Each value represents a distinct scenario for power assessment. The ordering in nCasesTx and nControlsTx must match.

nCasesTxWithS

an integer vector specifying the observed (for a finished trial) or expected (for a trial in design stage) number of clinical endpoint cases between τ and τ_{max} in the active treatment group with an available biomarker response. Each value represents a distinct scenario for power assessment. The ordering must match nCasesTx and nControlsTx.

controlCaseRatio

an integer vector specifying the number of closeout controls sampled per case for biomarker measurement in the without replacement case-control sampling design (set to NULL by default). Each value represents a distinct scenario for power assessment.

VEoverall

a numeric value specifying the true overall treatment (vaccine) efficacy between τ and τ_{max}

risk0

a numeric value specifying the overall placebo-group endpoint risk between τ and τ_{max}

VElat0

a numeric vector specifying a grid of treatment (vaccine) efficacy levels in the latent lower protected subgroup for a dichotomous or trichotomous biomarker. Each value of VElat0 corresponds to one unique effect size (RR_t). Default ranges from VEoverall (H_0) to 0 (maximal H_1 not allowing harm by treatment).

VElat1

a numeric vector specifying a grid of treatment (vaccine) efficacy levels in the latent medium protected subgroup for a trichotomous biomarker. Each value corresponds to one unique effect size (RR_t). The ordering must match VElat0. Set to VEoverall by default.

VElowest

a numeric vector specifying a grid of treatment (vaccine) efficacy levels in the latent lowest-efficacy subgroup for a continuous biomarker. Default ranges from VEoverall (H_0) to 0 (maximal H_1 not allowing harm by treatment).

Plat0

a numeric vector specifying the prevalence of the latent lower protected subgroup for a dichotomous or trichotomous biomarker (set to NULL by default). Each value represents a distinct scenario for power assessment. The ordering in Plat0, Plat2, P0, and P2 must match.

Plat2

a numeric vector specifying the prevalence of the latent higher protected subgroup for a dichotomous or trichotomous biomarker (set to NULL by default). Each value represents a distinct scenario for power assessment. The ordering in Plat0, Plat2, P0, and P2 must match.

P0

a numeric vector specifying the probability of low biomarker response for a dichotomous or trichotomous biomarker (set to Plat0 by default). Each value represents a distinct scenario for power assessment. The ordering in Plat0, Plat2, P0, and P2 must match.

P2

a numeric vector specifying the probability of high biomarker response for a dichotomous or trichotomous biomarker (set to Plat2 by default). Each value represents a distinct scenario for power assessment. The ordering in Plat0, Plat2, P0, and P2 must match.

PlatVElowest

a numeric vector specifying the prevalence of the latent lowest-efficacy subgroup for a continuous biomarker (set to NULL by default). Each value represents a distinct scenario for power assessment.

sens

a numeric vector specifying the sensitivity, i.e., the probability of high biomarker response conditional on membership in the higher protected subgroup, for a dichotomous or trichotomous biomarker. Default is NULL, which indicates the use of 'approach 2'. Each value represents a distinct scenario for power assessment. The ordering in sens, spec, FP0, and FN2 must match.

spec

a numeric vector specifying the specificity, i.e., the probability of low biomarker response conditional on membership in the lower protected subgroup, of a dichotomous or trichotomous biomarker. Default is NULL, which indicates the use of 'approach 2'. Each value represents a distinct scenario for power assessment. The ordering in sens, spec, FP0, and FN2 must match.

FP0

a numeric vector specifying the false positive rate, i.e., the probability of high biomarker response conditional on membership in the lower protected subgroup, for a dichotomous or trichotomous biomarker. Default is NULL, which indicates the use of 'approach 2'. Each value represents a distinct scenario for power assessment. The ordering in sens, spec, FP0, and FN2 must match.

FN2

a numeric vector specifying the false negative rate, i.e., the probability of low biomarker response conditional on membership in the higher protected subgroup, for a dichotomous or trichotomous biomarker. Default is NULL, which indicates the use of 'approach 2'. Each value represents a distinct scenario for power assessment. The ordering in sens, spec, FP0, and FN2 must match.

M

an integer value specifying the number of simulated clinical trials. Default is 100.

alpha

a numeric value specifying the two-sided Wald test type-I error rate. Default is 0.05.

sigma2obs

a numeric value specifying the variance of the observed continuous biomarker or of the dichotomous or trichotomous biomarker simulated using 'approach 2' (set to 1 by default).

rho

a numeric vector specifying distinct protection-relevant fractions of sigma2obs. Each value represents a distinct scenario for power assessment.

biomType

a character string specifying the biomarker type. Default is continuous; other choices are dichotomous and trichotomous.

cohort

a logical value for whether a case-cohort Bernoulli sampling design is to be used. If FALSE (default), the case-control without replacement sampling is used.

p

a numeric vector specifying the probability of sampling into the subcohort in the case-cohort design (NULL by default). Each value represents a distinct scenario for power assessment.

tpsMethod

a character string specifying the estimation method in the inverse probability weighted logistic regression model fit by the tps function in the osDesign package. The options are PL for pseudo-likelihood (default), ML for maximum likelihood, and WL for weighted likelihood.

saveDir

a character string specifying the path for a directory in which the output of the power calculation is to be saved. If NULL (default), the output is returned only.

saveFile

a character vector specifying the name(s) of the .RData file(s) storing the output of the power calculation, used only if saveDir is not NULL. All file names must include ".RData" at the end. Default is CoRpower.RData.

saveDataDir

a character string specifying the path for a directory in which the simulated data, including placebo group and baseline immunogenicity predictor (BIP) data, are to be saved. If NULL (default), the simulated data are not saved.

saveDataFile

a character vector specifying the name(s) of the .RData file(s) in which the simulated data, including placebo group and BIP data, are to be saved; used only if saveDataDir is not NULL. All file names must include ".RData" at the end. Default is fullData.RData.

corr

a numeric vector in [-1,1] specifying the correlation between a continuous baseline immunogenicity predictor (BIP) and the (underlying) continuous intermediate biomarker response (NULL by default). Each value represents a distinct scenario for power assessment. A useful BIP is highly correlated with the biomarker response at τ. It must be provided if saveDataDir is specified and a trichotomous biomarker under 'approach 2' or a continuous biomarker is considered.

nCasesPla

an integer vector specifying the observed (for a finished trial) or expected (for a trial in design stage) number of clinical endpoint cases between τ and τ_{max} in the placebo group. Each value represents a distinct scenario matching nCasesTx. Default is NULL. It must be provided if saveDataDir is specified.

nControlsPla

an integer vector specifying the observed (for a finished trial) or expected (for a trial in design stage) number of controls with completed follow-up through τ_{max} and endpoint-free at τ_{max} in the placebo group. Each value represents a distinct scenario matching nControlsTx. Default is NULL. It must be provided if saveDataDir is specified.

sensBIP

a numeric vector specifying "the sensitivity" of a dichotomous or trichotomous BIP, i.e., the probability of a high value of the BIP conditional on high biomarker response. Default is NULL, which indicates the use of 'approach 2'. It must be provided if saveDataDir is specified and 'approach 1' is to be used. Each value results in generating a separate BIP variable in the output data.

specBIP

a numeric vector specifying "the specificity" of a dichotomous or trichotomous BIP, i.e., the probability of a low value of the BIP conditional on low biomarker response. Default is NULL, which indicates the use of 'approach 2'. It must be provided if saveDataDir is specified and 'approach 1' is to be used. Each value results in generating a separate BIP variable in the output data.

FP0BIP

a numeric vector specifying "the false positive rate" of a dichotomous or trichotomous BIP, i.e., the probability of a high value of the BIP conditional on low biomarker response. Default is NULL, which indicates the use of 'approach 2'. It must be provided if saveDataDir is specified and 'approach 1' is to be used. Each value results in generating a separate BIP variable in the output data.

FN2BIP

a numeric vector specifying "the false negative rate" of a dichotomous or trichotomous BIP, i.e., the probability of a low value of the BIP conditional on high biomarker response. Default is NULL, which indicates the use of 'approach 2'. It must be provided if saveDataDir is specified and 'approach 1' is to be used. Each value results in generating a separate BIP variable in the output data.

P0BIP

a numeric vector specifying the probability of a low value of a dichotomous or trichotomous BIP. If unspecified, it is set to P0. Each value results in generating a separate BIP variable in the output data.

P2BIP

a numeric vector specifying the probability of a high value of a dichotomous or trichotomous BIP. If unspecified, it is set to P2. Each value results in generating a separate BIP variable in the output data.

Details

A number of calling arguments can be specified as vectors with each component specifying a distinct scenario for power assessment (saved in a separate .RData file). These are referred to as "varying arguments." Some varying arguments occur in a group, where the length and order of all specified vectors in the group must match; others are the only varying argument in their group. Only arguments belonging to a single group may be varied at a time; if two or more groups contain vector inputs, the function will treat such inputs as an error. The following are the groups of varying arguments that can be vectorized:

Arguments independent of biomarker type and sampling design: nCasesTx, nControlsTx, nCasesTxWithS, VEoverall, risk0, M, alpha, tpsMethod, saveDir, saveFile.

Arguments specific to a trichotomous (or dichotomous) biomarker response: VElat0, VElat1, Plat0, Plat2, P0, P2, biomType = "trichotomous" (or "dichotomous")

Arguments specific to a continuous biomarker response: VElowest, PlatVElowest, sigma2obs, rho, biomType = "continuous"

Arguments for a case-control without replacement sampling design: controlCaseRatio

Arguments for a case-cohort Bernoulli sampling design: cohort = TRUE, p

To save output from the power calculations in an .RData file, saveDir must be specified. The default file name is CoRpower.RData; a different file name may be specified by saveFile as a single character string, to which the value of the varying argument(s) will be appended for descriptive file naming purposes, or, alternatively, a character vector may be specified with full file names (a single file will be produced for each value of the varying argument(s)).

To link power calculations for detecting a correlate of risk and a correlate of treatment efficacy, simulated data sets used in the power calculations can be exported with placebo-group data, with a possible extension including BIP data, for harmonized use by methods assessing biomarker-specific treatment efficacy. The vignette "Algorithms for Simulating Placebo Group and Baseline Immunogenicity Predictor Data" provides more information on the algorithms and underlying assumptions for simulating placebo-group and BIP data. The exported data sets include treatment and placebo group data in the form of full rectangular data (i.e., disregarding biomarker sub-sampling), which enables the user to employ any preferred biomarker sub-sampling design. To generate and export such data, saveDataDir, nCasesPla, and nControlsPla must be specified. nCasesPla and nControlsPla must have the same length and order of components as nCasesTx, nControlsTx, and nCasesTxWithS.

If a BIP is to be included in the simulated data export, additional arguments are necessary. If the biomarker is trichotomous and Approach 1 is used, sensBIP, specBIP, FP0BIP, FN2BIP, P0BIP, and P2BIP must be specified; if the biomarker is trichotomous and Approach 2 is used, corr, P0BIP, and P2BIP must be specified; if the biomarker is continuous, corr must be specified.

Calling arguments pertaining to the simulation of the BIP in the exported data may also be specified as vectors, independently of the above varying arguments defining the power calculation scenarios for the active treatment group. Each component of these vectors results in the generation of a separate BIP variable, in the same order, in the output data. Some of these arguments occur in a group, where the length and order of all specified vectors in the group must match; others are the sole argument in their group. Only arguments belonging to a single group may be varied at a time; if two or more groups contain vector inputs, the function will treat such inputs as an error. The following are the groups of BIP arguments that can be vectorized:

The default file name for the outputted data sets is fullData.RData. A different file name may be specified by saveDataFile as a single character string, to which the value of the "varying argument" for the power calculations will be appended for descriptive file naming purposes, or, alternatively, a character vector may be specified with full file names (a single file will be produced for each value of the varying argument(s)). Note: if the "varying argument" is controlCaseRatio or p, only one file will be generated because these arguments do not affect the simulation of the full data; therefore, saveDataFile must be a character string in these cases.

Value

If saveDir is specified, an output list (named pwr) for each power scenario is saved as an .RData file. Otherwise, the function returns a list of lists, where the outer list ranges over specified values of the varying argument(s) whose components denote distinct scenarios, and the inner list is the output list for each power scenario. For a dichotomous or trichotomous biomarker, each output list has the following components:

For a continuous biomarker, each output list has the following components:

If saveDataDir is specified, the simulated data, including placebo group and BIP data, are saved in one or more .RData file(s) containing a list of lists of data frames. The components of the outer list consist each of one Monte-Carlo iteration of simulated data for all values of VElat0 or VElat1 if the biomarker is trichotomous, or of VElowest if the biomarker is continuous. Each data frame corresponds to one simulated trial.

See Also

computeN, plotPowerTri, plotPowerCont

Examples


## Trichotomous biomarker, Approach 1, varying sens and spec ##
## Specify sens, spec, FP0, FN2
nCasesTx <- 32
nControlsTx <- 1000
nCasesTxWithS <- 32
controlCaseRatio <- 5
VEoverall <- 0.75
risk0 <- 0.034
VElat0 <- seq(0, VEoverall, len=20)  # 20 data points for the power curve
VElat1 <- rep(VEoverall, 20)
Plat0 <- 0.2
Plat2 <- 0.6
P0 <- Plat0  # different values of P0 can be set
P2 <- Plat2  # different values of P2 can be set
sens <- spec <- c(1, 0.9, 0.8, 0.7)
FP0 <- FN2 <- rep(0, 4)
M <- 5
alpha <- 0.05
biomType <- "trichotomous"
computePower(nCasesTx=nCasesTx, nControlsTx=nControlsTx, nCasesTxWithS=nCasesTxWithS,
             controlCaseRatio=controlCaseRatio, VEoverall=VEoverall,
             risk0=risk0, VElat0=VElat0, VElat1=VElat1, Plat0=Plat0,
             Plat2=Plat2, P0=P0, P2=P2, M=M, alpha=alpha, spec=spec,
             FP0=FP0, sens=sens, FN2=FN2, biomType=biomType)

## Not run: 
## Trichotomous biomarker, Approach 2, varying rho ##
## Saving simulated data (including placebo and BIP data)
## Specify rho, sigma2obs, saveDataDir, saveDataFile, corr

nCasesTx <- 32
nControlsTx <- 1000
nCasesTxWithS <- 32
controlCaseRatio <- 5
VEoverall <- 0.75
risk0 <- 0.034
VElat0 <- seq(0, VEoverall, len=20)
VElat1 <- rep(VEoverall, 20)
Plat0 <- 0.2
Plat2 <- 0.6
P0 <- Plat0
P2 <- Plat2
M <- 5
alpha <- 0.05
sigma2obs <- 1
rho <- c(1, 0.9, 0.7, 0.5)
biomType <- "trichotomous"
saveDataDir <- "~/myDir"
saveDataFile <- "myDataFile.RData"
corr <- 0.7
computePower(nCasesTx=nCasesTx, nControlsTx=nControlsTx, nCasesTxWithS=nCasesTxWithS,
             controlCaseRatio=controlCaseRatio, VEoverall=VEoverall, risk0=risk0,
             VElat0=VElat0, VElat1=VElat1, Plat0=Plat0, Plat2=Plat2, P0=P0, P2=P2,
             M=M, alpha=alpha, sigma2obs=sigma2obs, rho=rho, biomType=biomType,
             saveDataDir=saveDataDir, saveDataFile=saveDataFile, corr=corr)


## dichotomous biomarker, Approach 2, varying rho ##
## Plat0 + Plat2 = 1

nCasesTx <- 32
nControlsTx <- 1000
nCasesTxWithS <- 32
controlCaseRatio <- 5
VEoverall <- 0.75
risk0 <- 0.034
VElat0 <- seq(0, VEoverall, len=20)  # 20 data points for the power curve
VElat1 <- rep(0, 20)  # will not be used by function
Plat0 <- 0.25
Plat2 <- 1 - Plat0
P0 <- Plat0
P2 <- Plat2
M <- 5
alpha <- 0.05
sigma2obs <- 1
rho <- c(1, 0.9, 0.7, 0.5)
biomType <- "dichotomous"
computePower(nCasesTx=nCasesTx, nControlsTx=nControlsTx, nCasesTxWithS=nCasesTxWithS,
             controlCaseRatio=controlCaseRatio, VEoverall=VEoverall, risk0=risk0,
             VElat0=VElat0, VElat1=VElat1, Plat0=Plat0, Plat2=Plat2, P0=P0, P2=P2,
             M=M, alpha=alpha, sigma2obs=sigma2obs, rho=rho, biomType=biomType)


## Continuous biomarker, varying rho ##

nCasesTx <- 32
nControlsTx <- 1000
nCasesTxWithS <- 32
controlCaseRatio <- 5
VEoverall <- 0.75
risk0 <- 0.034
PlatVElowest <- 0.2
VElowest <- seq(0, VEoverall, len=20)
M <- 5
alpha <- 0.05
sigma2obs <- 1
rho <- c(1, 0.9, 0.7, 0.5)
biomType <- "continuous"
computePower(nCasesTx=nCasesTx, nControlsTx=nControlsTx, nCasesTxWithS=nCasesTxWithS,
             controlCaseRatio=controlCaseRatio, VEoverall=VEoverall, risk0=risk0,
             PlatVElowest=PlatVElowest, VElowest=VElowest, M=M, alpha=alpha,
             sigma2obs=sigma2obs, rho=rho, biomType=biomType)


## Continuous biomarker, case-cohort sampling design, varying p ##
nCasesTx <- 32
nControlsTx <- 1000
nCasesTxWithS <- 32
VEoverall <- 0.75
risk0 <- 0.034
PlatVElowest <- 0.2
VElowest <- seq(0, VEoverall, len=20)
M <- 5
alpha <- 0.05
sigma2obs <- 1
rho <- 0.9
biomType <- "continuous"
cohort <- TRUE
p <- c(0.01, 0.02, 0.03)
computePower(nCasesTx=nCasesTx, nControlsTx=nControlsTx, nCasesTxWithS=nCasesTxWithS,
             VEoverall=VEoverall, risk0=risk0, PlatVElowest=PlatVElowest,
             VElowest=VElowest, M=M, alpha=alpha, sigma2obs=sigma2obs,
             rho=rho, biomType=biomType, cohort=cohort, p=p)

## Continuous biomarker, saving output, varying sample sizes ##

nCasesTx <- 32
nControlsTx <- 1000
nCasesTxWithS <- 32
controlCaseRatio <- 5
VEoverall <- 0.75
risk0 <- 0.034
PlatVElowest <- 0.2
VElowest <- seq(0, VEoverall, len=20)
M <- 5
alpha <- 0.05
sigma2obs <- 1
rho <- c(1, 0.9, 0.7, 0.5)
biomType <- "continuous"
saveDir <- "~/myDir"
saveFile <- "MyFile.RData"
computePower(nCasesTx=nCasesTx, nCasesTxWithS=nCasesTxWithS, nControlsTx=nControlsTx,
             controlCaseRatio=controlCaseRatio, VEoverall=VEoverall,
             risk0=risk0, PlatVElowest=PlatVElowest, VElowest=VElowest,
             M=M, alpha=alpha, sigma2obs=sigma2obs, rho=rho,
             biomType=biomType, saveDir=saveDir, saveFile=saveFile)

## End(Not run)


[Package CoRpower version 1.0.4 Index]