# Introduction

The package contains functions to calculate power and estimate sample size for various study designs used in (not only bio-) equivalence studies. Power and sample size can be obtained based on different methods, amongst them prominently the TOST procedure (Two One-Sided t-Tests).
Version 1.5.4 built 2022-02-21 with R 4.1.2.

For an overview of supported designs, methods, and defaults together with some basic examples see

• README of the released version on CRAN;
• README of the development version on GitHub.

# Abbreviations, Definition of Terms, Models

2×2×2
Crossover design with 2 treatments, 2 sequences, and 2 periods. In the literature also TR|RT or AB|AB. In the functions 2x2x2 or 2x2 for short.
2x2x3
Full replicate designs with 2 treatments, 2 sequences, and 3 periods (TRT|RTR or TRR|RTT). Both T and R are administered twice to ½ of the subjects.
2x2x4
Full replicate designs with 2 treatments, 2 sequences, and 4 periods (TRTR|RTRT, TRRT|RTTR, or TTRR|RRTT). Both T and R are administered twice to ½ of the subjects.
2×3×3
Partial (or semi-) replicate design with 2 treatments, 3 sequences, and 3 periods (TRR|RTR|RRT or TRR|RTR). R is administered to all subjects twice and T once. The former is popular (though not optimal) and the latter (a.k.a. extra-reference design) not optimal because it is biased in the presence of period effects.
2×4×2
Full replicate design with 2 treatments, 4 sequences, and 2 periods (TR|RT|TT|RR, Balaam’s design). Not optimal due to poor power characteristics.
2×4×4
Full replicate designs with 2 treatments, 4 sequences, and 4 periods (TRTR|RTRT|TRRT|RTTR or TRTR|RTRT|TTRR|RRTT).
3×3, 3×6×3
Higher-order crossover designs with 3 treatments, 3 or 6 sequences, and 3 periods (Latin Square ABC|BCA|CAB or the Williams’ design ABC|ACB|BAC|BCA|CAB|CBA). In the functions 3x3 and 3x6x3. Both have the same degrees of freedom (2n–4) in the conventional approach and therefore, require the same number of subjects.
4×4
ABE
Average Bioequivalence with fixed limits based on a clinically not relevant difference $$\small{\Delta}$$. The common $$\small{\Delta}$$ 0.20 leads to $$\small{\theta_1=1-\Delta,\:\theta_2=1/(1-\Delta)}$$ or 80.00–125.00%. For NTIDs (EMA and other jurisdicions) $$\small{\Delta}$$ 0.10 (90.00–111.11%). For highly variable Cmax (Russian Federation, South Africa) $$\small{\Delta}$$ 0.25 (75.00–133.33%).$H_0:\;\frac{\mu_\textrm{T}}{\mu_\textrm{R}}\ni\left\{\theta_1,\,\theta_2\right\}\;vs\;H_1:\;\theta_1<\frac{\mu_\textrm{T}}{\mu_\textrm{R}}<\theta_2$
ABEL
Average Bioequivalence with expanding limits (see also L, U). Same model like for ABE but $$\small{\theta_1,\theta_2}$$ are based on the CVwR observed in the study.
$$\alpha$$
Nominal level of the test. In tests for equivalence commonly 0.05 (except for the ratio of two means with normality on original scale based on Fieller’s (‘fiducial’) confidence interval in function sampleN.RatioF() and for non-inferiority/-superiority in function sampleN.noninf(), where it is 0.025). In the functions alpha.
$$\beta$$
Probability that the Null-hypothesis of inequivalence is falsely not rejected. Also the type II error or producer’s risk, where $$\small{\beta=1-\pi}$$.
$$\beta_0$$
Assumed or true slope of the (linearized) power model of dose-proportionality $$\small{x=\alpha\cdot dose^{\,\beta},\:\log_{e}x=\alpha+\beta\cdot \log_{e}dose}$$. Argument beta0.
CV
Coefficient of variation
Calculated from the residual error of the model of log-transformed data as $$\small{CV=\sqrt{\exp (\sigma^2)+1}}$$.
• In crossover designs the within- (intra-) subject CV. Argument CV.
• In parallel designs the total (pooled) CV. Argument CV.
• In replicate designs the intra-subject CV (assuming homoscedasticity, argument CV). If hetero­scedasticity is assumed, CV has to given as a vector with two elements CV = c(x, y), where CV[1] is CVwT and CV[2] is CVwR.
CVb
Between- (inter-) subject coefficient of variation. Argument CVb is required in function sampleN.RatioF() and in function sampleN.dp() if design = "IBD" (incomplete block design).
CVcap
Upper cap in ABEL. If CVwR > CVcap, expanding is based on CVcap (and not on CVwR). In all jurisdictions 50%, except for Health Canada, where CVcap ≈57.4%.
CVswitch
Switching coefficient of variation in reference-scaling. Only above this value reference-scaling is acceptable. For highly variable drugs / drug products 30% (CV0 0.30, s0 0.294).
CVwR
Within-subject coefficient of variation of R; can be estimated in any replicate design.
CVwT
Within-subject coefficient of variation of T; can be estimated only in full replicate designs.
$$\small{\Delta}$$
Clinically not relevant difference. Commonly 0.20. For NTIDs (EMA and other jurisdictions) $$\small{\Delta}$$ 0.10, for Cmax (Russian Federation, South Africa) $$\small{\Delta}$$ 0.25.
HVD(P)
Highly variable drug (product); commonly defined with a CVwR of ≥30%. HVDs exhibit highly variable clearances (CVwR ≥30% if administered as a solution), whereas HVDPs may additionally – or solely – show highly variable absorption. HVDP(s) generally are ones with a flat dose-response curve.
k
Regulatory constant (also $$\small{\theta_\textrm{s}}$$)

ABEL: Based on the switching coefficient of variation $$\small{CV_0=30\%}$$. $$\small{k=\log_{e}1.25/\sqrt{\log_{e}(CV_{0}^{2}+1)}\approx 0.760}$$.

RSABE: Based on the switching standard deviation $$\small{s_0=0.25}$$. $$\small{k=\log_{e}1.25/0.25\approx 0.8926}$$.
L, U
ABEL, RSABE
ABEL: Lower and upper expanded limits.
• 30% < CVwR ≤ 50%: Based on $$\small{s_\textrm{wR}}$$, where $$\small{\left\{ {L,\,U} \right\}= 100\cdot \exp (\mp 0.760 \cdot {s_\textrm{wR}})}$$
• CVwR > CVcap: Applying $$\small{s^*_\textrm{wR}=\sqrt{\log_{e}(CV_\textrm{cap}^{2}+1)}}$$ in the expansion formula: $$\small{\left\{ {L,\,U} \right\} = {69.84 - 143.19\%}}$$. All jurisdictions except Health Canada, where $$\small{\left\{ {L,\,U} \right\} = {66.7 - 150.0\%}}$$.
RSABE: Lower and upper ‘implied limits’.
• If $$\small{s_\textrm{wR}\geq 0.294: \left\{ {L,\: U} \right\} = 100\cdot \exp (\mp 0.8926 \cdot {s_\textrm{wR}})}$$
Dose-Proportionality

$$\small{\left\{ {L,\,U} \right\}=\left[1+\log_{e}0.80/\log_{e}rd,\:1+\log_{e}1.25/\log_{e}rd \right]}$$

margin
Non-inferiority/-superiority margin (example for logscale = TRUE where $$\theta_0=\mu_\textrm{T}/\mu_\textrm{R}$$).

Non-inferiority: If margin < 1, higher responses are are assumed to be better. $\small{H_0:\,\theta_0 \leq \log_{e}\textrm{margin}\:vs\:H_1:\,\theta_0>\log_{e}\textrm{margin}}$

Non-superiority: If margin > 1, lower responses are are assumed to be better. $\small{H_0:\,\theta_0 \geq \log_{e}\textrm{margin}\:vs\:H_1:\,\theta_0<\log_{e}\textrm{margin}}$
n
(Total) number of subjects.
nseq
Number of sequences.
NTID
Narrow therapeutic index drug, i.e., with a steep dose-response curve. A.k.a. NRD (Narrow Range Drug).
$$\pi$$
Target (or desired) power in study planning. Commonly set to 0.80 – 0.90. In the functions targetpower.
R
Reference (treatment, product).
rd
Ratio of the highest/lowest dose. In the functions rd.
robust
Selects degrees of freedom according to Senn’s basic estimator, where $$\small{df=n-n_\textrm{seq}}$$.
RSABE
Reference-scaled Average Bioequivalence (U.S. FDA, China NMPA-CDE). Applicable if the intra-subject variability of the reference treatment swR ≥0.294 (CVwR ≈ 30%). The linearized model is $\small{H_0:(\mu_\textrm{T}/\mu_\textrm{R})^2-\theta_\textrm{s}\cdot s_\textrm{wR}^{2}>0\:vs\:H_1:(\mu_\textrm{T}/\mu_\textrm{R})^2-\theta_\textrm{s}\cdot s_\textrm{wR}^{2}\leq 0}$ See also ABEL.
$$\theta_0$$
Assumed or true T/R-ratio (logscale = TRUE) or difference T – R (logscale = FALSE). In the functions theta0.
$$\theta_1,\theta_2$$
Lower and upper limits of the equivalence range. In the functions theta1 and theta2.
$$\theta_s$$
T
Test (treatment, product).
TIE (type I error)
Probability that the Null-hypothesis of inequivalence is falsely rejected (i.e., equivalence is concluded). Also the patient’s risk. Can be assessed with the power-functions setting theta0 = theta2 or theta0 = theta1.
Exact, except in reference-scaling based on simulations (power.scABEL(), power.RSABE(), power.NTIDFDA(), power.HVNTID()).

# A Note on Rounding

In all functions sample sizes are estimated based on equivalence margins [$$\small{\theta_1,\theta_2}$$] in full numeric precision. The widened margins for highly variable Cmax are $$\small{\theta_1=0.75,}$$ $$\small{\theta_2=1/\theta_1=1.\dot{3}}$$ and not the rounded 75.00 – 133.33% according to the guidelines of the Russian Federation, the EEU, and the GCC. If for a NTID theta1 = 0.90 is specified, $$\small{\theta_2=1/\theta_1=1.\dot{1}}$$ and not the rounded 111.11% as in the guidelines. Health Canada requires rounding to only one decimal place with bioequivalence margins for NTIDs of 90.0 – 112.0%.
Estimated sample sizes are generally not affected or – in extremely rare cases – conservative.

Example for a HVDP ($$\small{\theta_0}$$ 0.90, design 2x2x4) and a NTID ($$\small{\theta_0}$$ 0.975, design 2x2x2):

#     CV     agency method   L       U     n   theta1   theta2  n
#  0.574        EMA   ABEL 69.84% 143.19% 30 0.698368 1.431910 30
#  0.574         HC   ABEL 66.7 % 150.0 % 28 0.666667 1.500000 28
#  0.574 RU/EEU/GGC    ABE 75.00% 133.33% 34 0.750000 1.333333 34
#  0.100        EMA    ABE 90.00% 111.11% 22 0.900000 1.111111 22
#  0.100         HC    ABE 90.0 % 112.0 % 22 0.900000 1.111111 22

# Installation

You can install the released version of PowerTOST from CRAN with …

package <- "PowerTOST"
inst    <- package %in% installed.packages()
if (length(package[!inst]) > 0) install.packages(package[!inst])

… and the development version from GitHub with

# install.packages("remotes")
remotes::install_github("Detlew/PowerTOST")

Skips installation from a github remote if the SHA-1 has not changed since last install. Use force = TRUE to force installation.

# Contributors

• Detlew Labes (author, maintainer)
• Helmut Schütz (author)
• Benjamin Lang (author)