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 |
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 |
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 |
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 |
VEoverall |
a numeric value specifying the true overall treatment (vaccine) efficacy between |
risk0 |
a numeric value specifying the overall placebo-group endpoint risk between |
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 |
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 ( |
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 |
Plat0 |
a numeric vector specifying the prevalence of the latent lower protected subgroup for a dichotomous or trichotomous biomarker (set to |
Plat2 |
a numeric vector specifying the prevalence of the latent higher protected subgroup for a dichotomous or trichotomous biomarker (set to |
P0 |
a numeric vector specifying the probability of low biomarker response for a dichotomous or trichotomous biomarker (set to |
P2 |
a numeric vector specifying the probability of high biomarker response for a dichotomous or trichotomous biomarker (set to |
PlatVElowest |
a numeric vector specifying the prevalence of the latent lowest-efficacy subgroup for a continuous biomarker (set to |
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 |
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 |
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 |
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 |
M |
an integer value specifying the number of simulated clinical trials. Default is |
alpha |
a numeric value specifying the two-sided Wald test type-I error rate. Default is |
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 |
rho |
a numeric vector specifying distinct protection-relevant fractions of |
biomType |
a character string specifying the biomarker type. Default is |
cohort |
a logical value for whether a case-cohort Bernoulli sampling design is to be used. If |
p |
a numeric vector specifying the probability of sampling into the subcohort in the case-cohort design ( |
tpsMethod |
a character string specifying the estimation method in the inverse probability weighted logistic regression model fit by the |
saveDir |
a character string specifying the path for a directory in which the output of the power calculation is to be saved. If |
saveFile |
a character vector specifying the name(s) of the |
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 |
saveDataFile |
a character vector specifying the name(s) of the |
corr |
a numeric vector in |
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 |
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 |
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 |
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 |
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 |
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 |
P0BIP |
a numeric vector specifying the probability of a low value of a dichotomous or trichotomous BIP. If unspecified, it is set to |
P2BIP |
a numeric vector specifying the probability of a high value of a dichotomous or trichotomous BIP. If unspecified, it is set to |
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:
-
nCasesTx
,nControlsTx
, andnCasesTxWithS
(together withnCasesPla
andnControlsPla
if simulated data sets are to be saved) -
Plat0
,Plat2
,P0
, andP2
-
sens
,spec
,FP0
, andFN2
-
controlCaseRatio
-
rho
-
p
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 for Approach 1:
sens
,spec
,FP0
,FN2
Arguments for Approach 2:
sigma2obs
,rho
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:
-
sensBIP
,specBIP
,FP0BIP
,FN2BIP
-
P0BIP
,P2BIP
-
corr
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:
-
power
: a numeric vector of fractions of simulated trials in which the null hypothesisH_0
is rejected. Each value of the vector corresponds to a value in the grid of treatment (vaccine) efficacies specified byVElat0
andVElat1
. -
RRt
: a numeric vector of correlate-of-risk relative-risk effect sizes. Each value of the vector corresponds to a value in the grid of treatment (vaccine) efficacies specified byVElat0
andVElat1
. -
risk1_2
: a numeric vector of conditional endpoint risks given a high biomarker response in the active treatment group. Each value of the vector corresponds to a value in the grid of treatment (vaccine) efficacies specified byVElat0
andVElat1
. -
risk1_0
: a numeric vector of conditional endpoint risks given a low biomarker response in the active treatment group. Each value of the vector corresponds to a value in the grid of treatment (vaccine) efficacies specified byVElat0
andVElat1
. -
VElat2
: a numeric vector specifying a grid of treatment (vaccine) efficacy levels in the latent higher protected subgroup for a dichotomous or trichotomous biomarker -
VElat0
: a numeric vector specifying a grid of treatment (vaccine) efficacy levels in the latent lower protected subgroup for a dichotomous or trichotomous biomarker -
Plat2
: a numeric value specifying the prevalence of the latent higher protected subgroup for a dichotomous or trichotomous biomarker -
Plat0
: a numeric value specifying the prevalence of the latent lower protected subgroup for a dichotomous or trichotomous biomarker -
P2
: a numeric value specifying the probability of high biomarker response for a dichotomous or trichotomous biomarker -
P0
: a numeric value specifying the probability of low biomarker response for a dichotomous or trichotomous biomarker -
alphaLat
: a numeric vector of the log odds of the clinical endpoint in the subgroup of active treatment recipients with the latentx^{\ast}=0
(this coefficient estimate applies to a continuous biomarker) -
betaLat
: a numeric vector of the log odds ratio of the clinical endpoint comparing two subgroups of active treatment recipients differing in the latentx^{\ast}
by 1 (this coefficient estimate applies to a continuous biomarker) -
sens
: a numeric vector of sensitivities (i.e., the probability of high biomarker response conditional on membership in the higher protected subgroup) of the observed dichotomous or trichotomous biomarker as a function ofrho
-
spec
: a numeric vector of specificities (i.e., the probability of low biomarker response conditional on membership in the lower protected subgroup) of the observed dichotomous or trichotomous biomarker as a function ofrho
-
FP0
: a numeric vector of false positive rates (i.e., the probability of high biomarker response conditional on membership in the lower protected subgroup) of the observed dichotomous or trichotomous biomarker as a function ofrho
-
FN2
: a numeric vector of false negative rates (i.e., the probability of low biomarker response conditional on membership in the higher protected subgroup) of the observed dichotomous or trichotomous biomarker as a function ofrho
-
NcompleteTx
: an integer value specifyingnCasesTx
+nControlsTx
, i.e., the number, observed or projected, of active treatment recipients at risk at\tau
with an observed endpoint or a completed follow-up through\tau_{max}
-
nCasesTx
: an integer value specifying the number of clinical endpoint cases observed (or projected) between\tau
and\tau_{max}
in the active treatment group -
nCasesTxWithS
: an integer value specifying the number of clinical endpoint cases observed (or projected) between\tau
and\tau_{max}
in the active treatment group with an available biomarker response -
controlCaseRatio
: an integer specifying the number of controls sampled per case for biomarker measurement in the without replacement case-control sampling design -
VEoverall
: a numeric value specifying the overall treatment (vaccine) efficacy between\tau
and\tau_{max}
-
risk0
: a numeric value specifying the overall placebo-group endpoint risk between\tau
and\tau_{max}
-
alpha
: a numeric value specifying the two-sided Wald test type-I error rate -
rho
: a numeric vector specifying distinct protection-relevant fractions of the variance of the observed biomarker -
approach
: a number denoting whether Approach 1 or Approach 2 was used (1 if sens, spec, FP0, FN2 were specified in the input; 2 if rho and sigma2obs were specified in the input) -
varyingArg
: a character string containing the name(s) and value(s) of the varying argument
For a continuous biomarker, each output list has the following components:
-
power
: a numeric vector of fractions of simulated trials in which the null hypothesisH_0
is rejected. Rows represent calculations for different values ofrho
ornCasesTx
, depending on which is a vector. Columns represent calculations for the grid of treatment (vaccine) efficacy levels in the latent lowest-efficacy subgroup, specified byVElowest
. -
RRc
: a numeric vector of correlate-of-risk relative-risk effect sizes as a function of the grid of treatment (vaccine) efficacy levels in the latent lowest-efficacy subgroup, specified byVElowest
-
betaLat
: a numeric vector specifying the log odds ratio of the clinical endpoint comparing two subgroups of active treatment recipients differing in the latentx^{\ast}
by 1 (this coefficient estimate applies to a continuous biomarker) -
alphaLat
: a numeric vector specifying the the log odds of the clinical endpoint in the subgroup of active treatment recipients with the latentx^{\ast}=0
(this coefficient estimate applies to a continuous biomarker) -
PlatVElowest
: a numeric value specifying the prevalence of the latent lowest-efficacy subgroup for a continuous biomarker -
VElowest
: a numeric vector specifying a grid of treatment (vaccine) efficacy levels in the latent lowest-efficacy subgroup for a continuous biomarker -
sigma2obs
: a numeric value specifying the variance of the observed continuous biomarker or of the dichotomous or trichotomous biomarker simulated using 'approach 2' -
NcompleteTx
: an integer value specifyingnCasesTx
+nControlsTx
, i.e., the number, observed or projected, of active treatment recipients at risk at\tau
with an observed endpoint or a completed follow-up through\tau_{max}
-
nCasesTx
: an integer value specifying the number of clinical endpoint cases observed (or projected) between\tau
and\tau_{max}
in the active treatment group -
nCasesTxWithS
: an integer value specifying the number of clinical endpoint cases observed (or projected) between\tau
and\tau_{max}
in the active treatment group with an available biomarker response -
controlCaseRatio
: an integer value specifying the number of controls sampled per case for biomarker measurement in the without replacement case-control sampling design -
VEoverall
: a numeric value specifying the overall treatment (vaccine) efficacy between\tau
and\tau_{max}
-
risk0
: a numeric value specifying the overall placebo-group endpoint risk between\tau
and\tau_{max}
-
alpha
: a numeric value specifying the two-sided Wald test type-I error rate -
rho
: a numeric vector specifying distinct protection-relevant fractions of the variance of the observed biomarker -
varyingArg
: a character string containing the name(s) and value(s) of the varying argument
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)