Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


lrstat (version 0.2.13)

getDesignEquiv: 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_
)

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.

Arguments

beta

The type II error.

IMax

The maximum information. Either beta or IMax should be provided while the other one should be missing.

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 (1:kMax) / kMax if left unspecified.

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 kMax for the error spending time at each analysis. Defaults to missing, in which case, it is the same as informationRates.

Author

Kaifeng Lu, kaifenglu@gmail.com

Details

Consider the equivalence design with two one-sided hypotheses: H10:θθ10, H20:θθ20. We reject H10 at or before look k if Z1j=(θ^jθ10)Ijbj for some j=1,,k, where {bj:j=1,,K} are the critical values associated with the specified alpha-spending function, and Ij is the information for θ (inverse variance of θ^ under the alternative hypothesis) at the jth look. For example, for estimating the risk difference θ=π1π2, Ij={π1(1π1)n1j+π2(1π2)n2j}1. It follows that (Z1jbj)=(Zjbj+(θ10θ)Ij), where Zj=(θ^jθ)Ij.

Similarly, we reject H20 at or before look k if Z2j=(θ^jθ20)Ijbj for some j=1,,k. We have (Z2jbj)=(Zjbj+(θ20θ)Ij).

Let lj=bj+(θ10θ)Ij, and uj=bj+(θ20θ)Ij. The cumulative probability to reject H0=H10H20 at or before look k under the alternative hypothesis H1 is given by Pθ(j=1k(Z1jbj)j=1k(Z2jbj))=p1+p2+p12, where p1=Pθ(j=1k(Z1jbj))=Pθ(j=1k(Zjlj)), p2=Pθ(j=1k(Z2jbj))=Pθ(j=1k(Zjuj)), and p12=Pθ(j=1k(Zjlj)(Zjuj)). Of note, both p1 and p2 can be evaluated using one-sided exit probabilities for group sequential designs. If there exists jk such that ljuj, then p12=1. Otherwise, p12 can be evaluated using two-sided exit probabilities for group sequential designs.

Since the equivalent hypothesis is tested using two one-sided tests, the type I error is controlled. To evaluate the attained type I error of the equivalence trial under H10 (or H20), we simply fix the control group parameters, update the active treatment group parameters according to the null hypothesis, and use the parameters in the power calculation outlined above.

Examples

Run this code

# 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"))

Run the code above in your browser using DataLab