D Some theory on equivalence trials
D.1 Type I error in equivalence trials
Assume we have a continuous outcome with variance \(\sigma^2\) and two treatment groups of size \(n_A\) and \(n_B\), respectively. Now consider the difference \(\bar d\) of the mean outcomes as treatment effect, so \(\bar d \sim \mathop{\mathrm{N}}(\Delta, \sigma^2 \, \lambda^2)\) where the true treatment difference is \(\Delta\) and \(\lambda = \sqrt{1/n_A+1/n_B}\).
Equivalence is established if the \(\gamma \cdot 100\) % confidence interval for the treatment difference is within the pre-specified interval of equivalence \((-\delta, \delta)\), i.e. \[ \bar d \pm z_{(1+\gamma)/2} \, \sigma \, \lambda \subset (-\delta, \delta). \] With \(z = z_{(1+\gamma)/2}\) we obtain the equivalent requirement \[ \bar d \in (-\xi, \xi) \, \mbox{ where } \xi = \delta - z_{(1+\gamma)/2} \, \sigma \, \lambda \]
to establish equivalence. This happens with probability
\[\begin{eqnarray} \tag{D.1} \operatorname{\mathsf{Pr}}(\bar d \in (-\xi, \xi) ) &=& \Phi\left(\frac{\xi - \Delta }{\lambda \, \sigma}\right) - \Phi\left(\frac{-\xi - \Delta }{\lambda \, \sigma}\right) \nonumber \\ &=& \Phi\left(\frac{\delta - \Delta }{\lambda \, \sigma} - z_{(1+\gamma)/2}\right) - \Phi\left(\frac{-\delta - \Delta }{\lambda \, \sigma} + z_{(1+\gamma)/2}\right). \end{eqnarray}\]
Now evaluate (D.1) at \(\Delta = \delta\) to obtain the Type I error rate (more precisely an upper bound on the Type I error rate)
\[\begin{eqnarray} \tag{D.2} \alpha = \Phi(-z_{(1+\gamma)/2}) - \Phi\left(z_{(1+\gamma)/2} - \frac{2 \delta}{\lambda \, \sigma}\right). \end{eqnarray}\]
Likewise, the power \(1 - \beta\) is derived from (D.1) with \(\Delta = 0\):
\[ 1 - \beta = 2 \Phi\left(\frac{\delta}{\lambda \, \sigma} - z_{(1+\gamma)/2}\right) - 1 \] so \[ 1 - \beta/2 = \Phi\left(\frac{\delta}{\lambda \, \sigma} - z_{(1+\gamma)/2}\right). \]
Note that \(1 - \beta/2 = \Phi(z_{1-\beta/2})\), and therefore
\[\begin{eqnarray} \tag{D.3} \frac{\delta}{\lambda \, \sigma} = z_{(1+\gamma)/2} + z_{1-\beta/2}. \end{eqnarray}\]
With (D.2) we obtain
\[\begin{eqnarray} \tag{D.3} \alpha \approx \Phi(-z_{(1+\gamma)/2}) = 1-(1+\gamma)/2 = (1-\gamma)/2 \end{eqnarray}\]
for relatively small \(\beta\) (say \(\beta \leq 30\) %), since the second term in (D.2)
\[ \Phi\left(z_{(1+\gamma)/2} - \frac{2 \delta}{\lambda \, \sigma}\right) = \Phi(z_{(1+\gamma)/2} - 2 \, (z_{(1+\gamma)/2} + z_{1-\beta/2})) = \Phi(-z_{(1+\gamma)/2} - 2 \, z_{1-\beta/2}) \]
is then very close to zero. Note that (D.3) differs from superiority trials, where \(\alpha = 1-\gamma\).
D.2 Sample size calulations in equivalence trials
Assume equal group sizes, i.e. \(n=n_A=n_B\), then \(\lambda=\sqrt{2/n}\).
With (D.3) we then obtain
\[\begin{eqnarray*} n &=& \frac{2 \sigma^2 (z_{(1+\gamma)/2} + z_{1-\beta/2})^2}{\delta^2} \\ &=& \frac{2 \sigma^2 (z_{1-\alpha} + z_{1-\beta/2})^2}{\delta^2} \end{eqnarray*}\]
as the required sample size in each group for Type I error rate \(\alpha\) and power \(1-\beta\).