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 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.

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:

H10:θθ10,H_{10}: \theta \leq \theta_{10},

H20:θθ20.H_{20}: \theta \geq \theta_{20}.

We reject H10H_{10} at or before look kk if

Z1j=(θ^jθ10)njv10bjZ_{1j} = (\hat{\theta}_j - \theta_{10})\sqrt{\frac{n_j}{v_{10}}} \geq b_j

for some j=1,,kj=1,\ldots,k, where {bj:j=1,,K}\{b_j:j=1,\ldots,K\} are the critical values associated with the specified alpha-spending function, and v10v_{10} is the null variance of θ^\hat{\theta} based on the restricted maximum likelihood (reml) estimate of model parameters subject to the constraint imposed by H10H_{10} for one sampling unit drawn from H1H_1. For example, for estimating the risk difference θ=π1π2\theta = \pi_1 - \pi_2, the asymptotic limits of the reml estimates of π1\pi_1 and π2\pi_2 subject to the constraint imposed by H10H_{10} are given by

(π~1,π~2)=f(θ10,r,rπ1,1r,(1r)π2),(\tilde{\pi}_1, \tilde{\pi}_2) = f(\theta_{10}, r, r\pi_1, 1-r, (1-r)\pi_2),

where f(θ0,n1,y1,n2,y2)f(\theta_0, n_1, y_1, n_2, y_2) is the function to obtain the reml of π1\pi_1 and π2\pi_2 subject to the constraint that π1π2=θ0\pi_1-\pi_2 = \theta_0 with observed data (n1,y1,n2,y2)(n_1, y_1, n_2, y_2) for the number of subjects and number of responses in the active treatment and control groups, rr is the randomization probability for the active treatment group, and

v10=π~1(1π~1)r+π~2(1π~2)1r.v_{10} = \frac{\tilde{\pi}_1 (1-\tilde{\pi}_1)}{r} + \frac{\tilde{\pi}_2 (1-\tilde{\pi}_2)}{1-r}.

Let Ij=nj/v1I_j = n_j/v_1 denote the information for θ\theta at the jjth look, where

v1=π1(1π1)r+π2(1π2)1rv_{1} = \frac{\pi_1 (1-\pi_1)}{r} + \frac{\pi_2 (1-\pi_2)}{1-r}

denotes the variance of θ^\hat{\theta} under H1H_1 for one sampling unit. It follows that

(Z1jbj)=(Zjw10bj+(θ10θ)Ij),(Z_{1j} \geq b_j) = (Z_j \geq w_{10} b_j + (\theta_{10}-\theta)\sqrt{I_j}),

where Zj=(θ^jθ)IjZ_j = (\hat{\theta}_j - \theta)\sqrt{I_j}, and w10=v10/v1w_{10} = \sqrt{v_{10}/v_1}.

Similarly, we reject H20H_{20} at or before look kk if

Z2j=(θ^jθ20)njv20bjZ_{2j} = (\hat{\theta}_j - \theta_{20})\sqrt{\frac{n_j}{v_{20}}} \leq -b_j

for some j=1,,kj=1,\ldots,k, where v20v_{20} is the null variance of θ^\hat{\theta} based on the reml estimate of model parameters subject to the constraint imposed by H20H_{20} for one sampling unit drawn from H1H_1. We have

(Z2jbj)=(Zjw20bj+(θ20θ)Ij),(Z_{2j} \leq -b_j) = (Z_j \leq -w_{20} b_j + (\theta_{20}-\theta)\sqrt{I_j}),

where w20=v20/v1w_{20} = \sqrt{v_{20}/v_1}.

Let lj=w10bj+(θ10θ)Ijl_j = w_{10}b_j + (\theta_{10}-\theta)\sqrt{I_j}, and uj=w20bj+(θ20θ)Iju_j = -w_{20}b_j + (\theta_{20}-\theta)\sqrt{I_j}. The cumulative probability to reject H0=H10H20H_0 = H_{10} \cup H_{20} at or before look kk under the alternative hypothesis H1H_1 is given by

Pθ(j=1k(Z1jbj)j=1k(Z2jbj))=p1+p2+p12,P_\theta\left(\cup_{j=1}^{k} (Z_{1j} \geq b_j) \cap \cup_{j=1}^{k} (Z_{2j} \leq -b_j)\right) = p_1 + p_2 + p_{12},

where

p1=Pθ(j=1k(Z1jbj))=Pθ(j=1k(Zjlj)),p_1 = P_\theta\left(\cup_{j=1}^{k} (Z_{1j} \geq b_j)\right) = P_\theta\left(\cup_{j=1}^{k} (Z_j \geq l_j)\right),

p2=Pθ(j=1k(Z2jbj))=Pθ(j=1k(Zjuj)),p_2 = P_\theta\left(\cup_{j=1}^{k} (Z_{2j} \leq -b_j)\right) = P_\theta\left(\cup_{j=1}^{k} (Z_j \leq u_j)\right),

and

p12=Pθ(j=1k{(Zjlj)(Zjuj)}).p_{12} = P_\theta\left(\cup_{j=1}^{k} \{(Z_j \geq l_j) \cup (Z_j \leq u_j)\}\right).

Of note, both p1p_1 and p2p_2 can be evaluated using one-sided exit probabilities for group sequential designs. If there exists jkj\leq k such that ljujl_j \leq u_j, then p12=1p_{12} = 1. Otherwise, p12p_{12} can be evaluated using two-sided exit probabilities for group sequential designs.

To evaluate the type I error of the equivalence trial under H10H_{10}, we first match the information under H10H_{10} with the information under H1H_1. For example, for estimating the risk difference for two independent samples, the sample size n10n_{10} under H10H_{10} must satisfy

1n10((π2+θ10)(1π2θ10)r+π2(1π2)1r)=1n(π1(1π1)r+π2(1π2)1r).\frac{1}{n_{10}}\left(\frac{(\pi_2 + \theta_{10}) (1 - \pi_2 - \theta_{10})}{r} + \frac{\pi_2 (1-\pi_2)}{1-r}\right) = \frac{1}{n}\left(\frac{\pi_1(1-\pi_1)}{r} + \frac{\pi_2 (1-\pi_2)}{1-r}\right).

Then we obtain the reml estimates of π1\pi_1 and π2\pi_2 subject to the constraint imposed by H20H_{20} for one sampling unit drawn from H10H_{10},

(π~10,π~20)=f(θ20,r,r(π2+θ10),1r,(1r)π2).(\tilde{\pi}_{10}, \tilde{\pi}_{20}) = f(\theta_{20}, r, r(\pi_2 + \theta_{10}), 1-r, (1-r)\pi_2).

Let tjt_j denote the information fraction at look jj. Define

v~1=(π2+θ10)(1π2θ10)r+π2(1π2)1r,\tilde{v}_1 = \frac{(\pi_2 + \theta_{10}) (1-\pi_2 -\theta_{10})}{r} + \frac{\pi_2 (1-\pi_2)}{1-r},

and

v~20=π~10(1π~10)r+π~20(1π~20)1r.\tilde{v}_{20} = \frac{\tilde{\pi}_{10}(1-\tilde{\pi}_{10})}{r} + \frac{\tilde{\pi}_{20} (1-\tilde{\pi}_{20})}{1-r}.

The cumulative rejection probability under H10H_{10} at or before look kk is given by

Pθ10(j=1k{(θ^jθ10)n10tj/v~1bj}j=1k{(θ^jθ20)n10tj/v~20bj})=q1+q2+q12,P_{\theta_{10}}\left(\cup_{j=1}^{k} \{(\hat{\theta}_j - \theta_{10}) \sqrt{n_{10} t_j/\tilde{v}_1} \geq b_j\} \cap \cup_{j=1}^{k} \{(\hat{\theta}_j - \theta_{20}) \sqrt{n_{10} t_j/\tilde{v}_{20}} \leq -b_j\}\right) = q_1 + q_2 + q_{12},

where

q1=Pθ10(j=1k{(θ^jθ10)n10tj/v~1bj})=Pθ10(j=1k(Zjbj)),q_1 = P_{\theta_{10}}\left(\cup_{j=1}^{k} \{(\hat{\theta}_j - \theta_{10}) \sqrt{n_{10} t_j/\tilde{v}_1} \geq b_j\}\right) = P_{\theta_{10}}\left(\cup_{j=1}^{k} (Z_j \geq b_j)\right),

q2=Pθ10(j=1k{(θ^jθ20)n10tj/v~20bj})=Pθ10(j=1k(Zjbjw21+(θ20θ10)Ij)),q_2 = P_{\theta_{10}}\left(\cup_{j=1}^{k} \{(\hat{\theta}_j - \theta_{20}) \sqrt{n_{10} t_j/\tilde{v}_{20}} \leq -b_j\}\right) = P_{\theta_{10}}\left(\cup_{j=1}^{k} (Z_j \leq -b_j w_{21} + (\theta_{20} - \theta_{10})\sqrt{I_j})\right),

and

q12=Pθ10(j=1k{(Zjbj)(Zjw21bj+(θ20θ10)Ij)}).q_{12} = P_{\theta_{10}}\left(\cup_{j=1}^{k} \{(Z_j \geq b_j) \cup (Z_j \leq -w_{21} b_j + (\theta_{20} - \theta_{10})\sqrt{I_j})\}\right).

Here Zj=(θ^jθ10)IjZ_j = (\hat{\theta}_j - \theta_{10}) \sqrt{I_j}, and w21=v~20/v~1w_{21} = \sqrt{\tilde{v}_{20}/\tilde{v}_1}. Of note, q1q_1, q2q_2, and q12q_{12} can be evaluated using group sequential exit probabilities. Similarly, we can define v~2\tilde{v}_2, v~10\tilde{v}_{10}, and w12=v~10/v~2w_{12} = \sqrt{\tilde{v}_{10}/\tilde{v}_2}, and evaluate the type I error under H20H_{20}.

The variance ratios correspond to

varianceRatioH10=v10/v1,\text{varianceRatioH10} = v_{10}/v_1,

varianceRatioH20=v20/v1,\text{varianceRatioH20} = v_{20}/v_1,

varianceRatioH12=v~10/v~2,\text{varianceRatioH12} = \tilde{v}_{10}/\tilde{v}_2,

varianceRatioH21=v~20/v~1.\text{varianceRatioH21} = \tilde{v}_{20}/\tilde{v}_1.

If the alternative variance is used, then the variance ratios are all equal to 1.

Value

An S3 class designEquiv object with three components:

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


[Package lrstat version 0.2.9 Index]