getDesignEquiv {lrstat} | R Documentation |
Power and sample size for a generic group sequential equivalence design
Description
Obtains the maximum information and stopping boundaries for a generic group sequential equivalence design assuming a constant treatment effect, or obtains the power given the maximum information and stopping boundaries.
Usage
getDesignEquiv(
beta = NA_real_,
IMax = NA_real_,
thetaLower = NA_real_,
thetaUpper = NA_real_,
theta = 0,
kMax = 1L,
informationRates = NA_real_,
criticalValues = NA_real_,
alpha = 0.05,
typeAlphaSpending = "sfOF",
parameterAlphaSpending = NA_real_,
userAlphaSpending = NA_real_,
spendingTime = NA_real_,
varianceRatioH10 = 1,
varianceRatioH20 = 1,
varianceRatioH12 = 1,
varianceRatioH21 = 1
)
Arguments
beta |
The type II error. |
IMax |
The maximum information. Either |
thetaLower |
The parameter value at the lower equivalence limit. |
thetaUpper |
The parameter value at the upper equivalence limit. |
theta |
The parameter value under the alternative hypothesis. |
kMax |
The maximum number of stages. |
informationRates |
The information rates. Fixed prior to the trial.
Defaults to |
criticalValues |
Upper boundaries on the z-test statistic scale for stopping for efficacy. |
alpha |
The significance level for each of the two one-sided tests, e.g., 0.05. |
typeAlphaSpending |
The type of alpha spending. One of the following: "OF" for O'Brien-Fleming boundaries, "P" for Pocock boundaries, "WT" for Wang & Tsiatis boundaries, "sfOF" for O'Brien-Fleming type spending function, "sfP" for Pocock type spending function, "sfKD" for Kim & DeMets spending function, "sfHSD" for Hwang, Shi & DeCani spending function, "user" for user defined spending, and "none" for no early efficacy stopping. Defaults to "sfOF". |
parameterAlphaSpending |
The parameter value for the alpha spending. Corresponds to Delta for "WT", rho for "sfKD", and gamma for "sfHSD". |
userAlphaSpending |
The user defined alpha spending. Cumulative alpha spent up to each stage. |
spendingTime |
A vector of length |
varianceRatioH10 |
The ratio of the variance under H10 to the variance under H1. |
varianceRatioH20 |
The ratio of the variance under H20 to the variance under H1. |
varianceRatioH12 |
The ratio of the variance under H10 to the variance under H20. |
varianceRatioH21 |
The ratio of the variance under H20 to the variance under H10. |
Details
Consider the equivalence design with two one-sided hypotheses:
We reject at or before look
if
for some , where
are the
critical values associated with the specified alpha-spending function,
and
is the null variance of
based on the restricted maximum likelihood (reml)
estimate of model parameters subject to the constraint imposed by
for one sampling unit drawn from
. For example,
for estimating the risk difference
,
the asymptotic limits of the
reml estimates of
and
subject to the constraint
imposed by
are given by
where is the function to obtain
the reml of
and
subject to the constraint that
with observed data
for the number of subjects and number of
responses in the active treatment and control groups,
is the randomization probability for the active treatment
group, and
Let denote the information for
at the
th look, where
denotes the variance of under
for one
sampling unit. It follows that
where , and
.
Similarly, we reject at or before look
if
for some , where
is the null
variance of
based on the reml estimate of model
parameters subject to the constraint imposed by
for
one sampling unit drawn from
. We have
where .
Let ,
and
.
The cumulative probability to reject
at
or before look
under the alternative hypothesis
is
given by
where
and
Of note, both and
can be evaluated using
one-sided exit probabilities for group sequential designs.
If there exists
such that
, then
. Otherwise,
can be evaluated using
two-sided exit probabilities for group sequential designs.
To evaluate the type I error of the equivalence trial under
, we first match the information under
with the information under
. For example, for estimating
the risk difference for two independent samples, the sample size
under
must satisfy
Then we obtain the reml estimates of and
subject to the constraint imposed by
for one sampling
unit drawn from
,
Let denote the information fraction at look
.
Define
and
The cumulative rejection probability under at or before
look
is given by
where
and
Here , and
.
Of note,
,
, and
can be evaluated using group sequential exit probabilities.
Similarly, we can define
,
,
and
, and
evaluate the type I error under
.
The variance ratios correspond to
If the alternative variance is used, then the variance ratios are all equal to 1.
Value
An S3 class designEquiv
object with three components:
-
overallResults
: A data frame containing the following variables:-
overallReject
: The overall rejection probability. -
alpha
: The overall significance level. -
attainedAlphaH10
: The attained significance level under H10. -
attainedAlphaH20
: The attained significance level under H20. -
kMax
: The number of stages. -
thetaLower
: The parameter value at the lower equivalence limit. -
thetaUpper
: The parameter value at the upper equivalence limit. -
theta
: The parameter value under the alternative hypothesis. -
information
: The maximum information. -
expectedInformationH1
: The expected information under H1. -
expectedInformationH10
: The expected information under H10. -
expectedInformationH20
: The expected information under H20.
-
-
byStageResults
: A data frame containing the following variables:-
informationRates
: The information rates. -
efficacyBounds
: The efficacy boundaries on the Z-scale for each of the two one-sided tests. -
rejectPerStage
: The probability for efficacy stopping. -
cumulativeRejection
: The cumulative probability for efficacy stopping. -
cumulativeAlphaSpent
: The cumulative alpha for each of the two one-sided tests. -
cumulativeAttainedAlphaH10
: The cumulative probability for efficacy stopping under H10. -
cumulativeAttainedAlphaH20
: The cumulative probability for efficacy stopping under H20. -
efficacyThetaLower
: The efficacy boundaries on the parameter scale for the one-sided null hypothesis at the lower equivalence limit. -
efficacyThetaUpper
: The efficacy boundaries on the parameter scale for the one-sided null hypothesis at the upper equivalence limit. -
efficacyP
: The efficacy bounds on the p-value scale for each of the two one-sided tests. -
information
: The cumulative information.
-
-
settings
: A list containing the following components:-
typeAlphaSpending
: The type of alpha spending. -
parameterAlphaSpending
: The parameter value for alpha spending. -
userAlphaSpending
: The user defined alpha spending. -
spendingTime
: The error spending time at each analysis. -
varianceRatioH10
: The ratio of the variance under H10 to the variance under H1. -
varianceRatioH20
: The ratio of the variance under H20 to the variance under H1. -
varianceRatioH12
: The ratio of the variance under H10 to the variance under H20. -
varianceRatioH21
: The ratio of the variance under H20 to the variance under H10.
-
Author(s)
Kaifeng Lu, kaifenglu@gmail.com
Examples
# Example 1: obtain the maximum information given power
(design1 <- getDesignEquiv(
beta = 0.2, thetaLower = log(0.8), thetaUpper = log(1.25),
kMax = 2, informationRates = c(0.5, 1),
alpha = 0.05, typeAlphaSpending = "sfOF"))
# Example 2: obtain power given the maximum information
(design2 <- getDesignEquiv(
IMax = 72.5, thetaLower = log(0.7), thetaUpper = -log(0.7),
kMax = 3, informationRates = c(0.5, 0.75, 1),
alpha = 0.05, typeAlphaSpending = "sfOF"))