Skip to content

Commit

Permalink
vignettes update
Browse files Browse the repository at this point in the history
  • Loading branch information
yboulag committed Jan 26, 2024
1 parent 0c441cb commit 399acf1
Show file tree
Hide file tree
Showing 5 changed files with 351 additions and 28 deletions.
3 changes: 1 addition & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ output: github_document
editor_options:
markdown:
wrap: sentence
bibliography: references.bib
always_allow_html: yes
---

Expand All @@ -30,7 +29,7 @@ asciicast::init_knitr_engine(

# `cTOST` Overview

This repository holds the `cTOST` R package. This package contains the function `tost` which provides an assessment of equivalence in the univariate framework based on the state-of-the-art Two One-Sided Tests (TOST). In addition, the package contains the functions `atost` and `dtost`, two corrective procedures applied to the TOST in the univariate framework in order to ensure the preservation of the Type I error rate at the desired nominal level and a uniform increase in power. These two functions output an assessment of equivalence in the univariate framework after their respective corrections is applied. More details can be found in @boulaguiem2023finite that you can access via this [link](https://www.biorxiv.org/content/10.1101/2023.03.11.532179v3).
This repository holds the `cTOST` R package. This package contains the function `tost` which provides an assessment of equivalence in the univariate framework based on the state-of-the-art Two One-Sided Tests (TOST). In addition, the package contains the functions `atost` and `dtost`, two corrective procedures applied to the TOST in the univariate framework in order to ensure the preservation of the Type I error rate at the desired nominal level and a uniform increase in power. These two functions output an assessment of equivalence in the univariate framework after their respective corrections is applied. More details can be found in Boulaguiem et al. (2023) that you can access via this [link](https://www.biorxiv.org/content/10.1101/2023.03.11.532179v3).

# Install Instructions

Expand Down
19 changes: 0 additions & 19 deletions references.bib

This file was deleted.

83 changes: 79 additions & 4 deletions vignettes/get_started.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "`cTOST` Vignette"
bibliography: references.bib
output:
rmarkdown::html_vignette:
fig_caption: yes
Expand All @@ -9,8 +10,82 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

```{r, echo=FALSE}
library(cTOST)
```

# Introduction

Equivalence testing has first appeared in the field of pharmacokinetics @Metzler74, and find their most common application in the context of generic drug manufacturing @SennBook21 where the aim is to determine whether a parameter like the mean variation of treatment response between a reference and a generic drug falls within a predetermined equivalence range that we denote $(-c,c)$, indicating that drugs are equivalent. Deviations within this region would be considered insignificant as they are too small to reflect the dissimilarity of the therapeutic effects between the compared treatments. In contrast to standard hypothesis testing for equality of means, where the null hypothesis assumes that both means are equal, and the alternative assumes they are not, equivalence testing reverses the roles of the hypothesis formulations and considers a region rather than a point. Specifically, it defines the alternative as the equivalence region within which the parameter of interest must lie for the treatments to be considered equivalent, and the null hypothesis as the opposite. This paradigm puts the burden of proof on equivalence, rather than non-equality, and emphasizes the importance of assessing the similarity of treatments in addition to their differences.

# Mathematical setup

More formally, the hypotheses of interest are defined as

\begin{equation}
H_0: \; \theta \not\in \Theta_1 \quad vs. \quad H_1: \; \theta \in \Theta_1 := (\theta_L, \, \theta_U),
\end{equation}


where $\Theta_1=(\theta_L,\theta_U)$ denotes the range of equivalence whose limits are known constants, and are usually symmetrical so we define $c:=\theta_U=-\theta_L$.

Existing approaches, such as the state-of-the-art Two One-Sided Tests (TOST) @schuirmann1987comparison, have demonstrated conservativeness and decreased power, particularly for highly variable responses. This can be demonstrated by computing the power function which would be evaluated at different points of the parameter space. In particular, evaluating it at the equivalence bounds yields the size and shows that it is strictly bounded by the significance level $\alpha$. To see this more clearly, consider a canonical form for the average equivalence problem in the univariate framework, which consists of two independent random variables $\widehat{\theta}$ and $\widehat{\sigma}_{\nu}$ with distributions

\begin{equation*}
\widehat{\theta} \sim N\left(\theta, \sigma_{\nu}^2\right), \quad \text{and} \quad \nu\frac{\widehat{\sigma}_{\nu}^2}{\sigma_{\nu}^2} \sim \chi^2_{\nu},
\end{equation*}
where $\theta$ is the parameter of interest, $\sigma_{\nu}$ is the standard error and $\nu$ are the degrees of freedom.

The TOST is based on two test statistics

\begin{equation*}
T_L := \frac{\widehat{\theta}+c}{\widehat{\sigma}_{\nu}}\sim t_\nu\left(\frac{\theta+c}{{\sigma}_\nu}\right), \quad\text{and}\quad T_U := \frac{\widehat{\theta}-c}{\widehat{\sigma}_{\nu}}\sim t_\nu\left(\frac{\theta-c}{{\sigma}_\nu}\right).
\end{equation*}
$\text{H}_{0}$ is rejected in favor of equivalence if both tests simultaneously reject their marginal null hypotheses, i.e.,

\begin{equation*}
T_L \geq t_{1-\alpha,\nu}, \quad \text{ and} \quad T_U \leq -t_{1-\alpha,\nu}.
\end{equation*}

By rearranging the terms, we can define a rejection region for the TOST:
\begin{equation*}
C_1 := \left\{\widehat{\theta} \in \mathbb{R},\, \widehat{\sigma}_{\nu} \in \mathbb{R}_+ \,\Big\vert \, \vert\widehat{\theta}\vert \leq c - t_{1-\alpha,\nu} \hat{\sigma}_\nu \right\}.
\end{equation*}

Given $\alpha$, $\theta$, $\sigma_{\nu}$, $\nu$ and $c$, the power function of the TOST corresponds to the probability of rejecting $H_0$, i.e., the integral of the joint density of $(\hat{\theta},\hat{\sigma}_\nu)$ over the rejection area $C_1$ (see also @Phil90), that is
\begin{equation*}
\begin{aligned}
p(\alpha, \theta, \sigma_{\nu}, \nu, c) :=& \Pr\left(T_L \geq t_{1-\alpha,\nu}\; \text{{ and}} \; T_U \leq -t_{1-\alpha,\nu}\, \big|\; \alpha, \theta, \sigma_{\nu}, \nu, c \right)\\
=&\int_0^\infty I(\widehat\sigma_\nu t_{1-\alpha,\nu} < c)\left\{\Phi\left(\frac{c+t_{\alpha,\nu} \widehat\sigma_\nu-\theta}{\sigma_\nu}\right)
-\Phi\left(-\frac{c+ t_{\alpha,\nu} \widehat\sigma_\nu+\theta}{\sigma_\nu}
\right) \right\} \\
\phantom{=}&\times f_W ( \widehat\sigma_\nu \lvert \sigma_\nu,\nu)d\widehat\sigma_\nu.
\end{aligned}
\end{equation*}
Noting that the vector $(T_L,T_U)$ has a bivariate non-central $t$-distribution with non-centrality parameters $\frac{\theta-c}{{\sigma}_\nu}$ and $\frac{\theta+c}{{\sigma}_\nu}$ respectively, we can express the power function in terms of Owen's $Q$-function @Owen65:
\begin{equation*}
\begin{aligned}
p(\alpha, \theta, \sigma_{\nu}, \nu, c) :=& Q_{\nu}\left(-t_{1-\alpha,\nu},\, \frac{\theta - c}{\sigma_{\nu}},\, \frac{c \sqrt{\nu}}{\sigma_{\nu} t_{1-\alpha,\nu}} \right) - Q_{\nu}\left(t_{1-\alpha,\nu},\, \frac{\theta + c}{\sigma_{\nu}},\, \frac{c \sqrt{\nu}}{\sigma_{\nu} t_{1-\alpha,\nu}} \right).
\end{aligned}
\end{equation*}

# Conservativeness of the TOST

This formulation allows to demonstrate that, for $\sigma_{\nu}>0$, the TOST is not size-$\alpha$ in finite samples as
\begin{equation*}
\begin{aligned}
\omega_\nu(\alpha, c, \sigma_{\nu}) &:= \sup_{\theta \, \in \, \Theta_0}\; p(\alpha, \theta, \sigma_{\nu}, \nu, c) \\
&< Q_{\nu}\left(-t_{1-\alpha,\nu},\, 0,\, \frac{c \sqrt{\nu}}{\sigma_{\nu} t_{1-\alpha,\nu}} \right) < \Pr\left(T_{\nu} \leq -t_{1-\alpha,\nu}\right) = \alpha,
\end{aligned}
\end{equation*}
where $\Theta_0:=\mathbb{R}\setminus(-c,c)$ corresponds to parameter space under the null.

# Finite sample corrections to the TOST

As $\omega_\nu(\gamma, \delta, \sigma_{\nu})$ is continuously differentiable and strictly increasing in $\gamma$ and $\delta$, solving the following matching paradigms represents a finite sample correction to the TOST and would ensure size-$\alpha$ tests:
$$\alpha^*:=\text{argzero}_{\gamma \in [\alpha, 0.5)} \;\big[ \omega_\nu(\gamma, c, \sigma_{\nu}) - \alpha\big],$$
$$c^*:=\text{argzero}_{\delta \in [1, \infty)} \;\big[ \omega_\nu(\alpha, \delta, \sigma_{\nu}) - \alpha\big].$$

The conditions under which the solutions are singletons and provide a uniformly more powerful inference are studied in length in @boulaguiem2023finite and compared to existing methods.

# References




73 changes: 73 additions & 0 deletions vignettes/references.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
@article{quartier2019cutaneous,
title={Cutaneous biodistribution: a high-resolution methodology to assess bioequivalence in topical skin delivery},
author={Quartier, Julie and Capony, Ninon and Lapteva, Maria and Kalia, Yogeshvar N},
journal={Pharmaceutics},
volume={11},
number={9},
pages={484},
year={2019},
publisher={MDPI}
}

@article{boulaguiem2023finite,
title={Finite Sample Adjustments for Average Equivalence Testing},
author={Boulaguiem, Younes and Quartier, Julie and Lapteva, Maria and Kalia, Yogeshvar N and Victoria-Feser, Maria-Pia and Guerrier, St{\'e}phane and Couturier, Dominique-Laurent},
journal={Statistics in Medicine},
pages={2023--03},
year={2023},
publisher={Cold Spring Harbor Laboratory}
}

@article{Metzler74,
author = {Metzler, C.M.},
year = {1974},
title = {Bioavailability -- A Problem in Equivalence},
journal = {Journal of Pharmaceutical Sciences},
volume = {30},
pages = {309--317}
}

@article{Westlake76,
author = {Westlake, T.W.},
year = {1976},
title = {Symmetrical Confidence Intervals for Bioequivalence Trials},
journal = {Biometrics},
volume = {32},
pages = {741--744}
}

@book{SennBook21,
author = {Senn, S.},
year = {2021},
title = {Statistical Issues in Drug Development, 3rd edition},
publisher = {Wiley},
}

@article{schuirmann1987comparison,
title={A comparison of the two one-sided tests procedure and the power approach for assessing the equivalence of average bioavailability},
author={Schuirmann, Donald J},
journal={Journal of Pharmacokinetics and Biopharmaceutics},
volume={15},
number={6},
pages={657--680},
year={1987},
publisher={Springer}
}

@article{Phil90,
author = {Phillips, K. },
title = {Power of the Two One-Sided Tests Procedure in Bioequivalence},
journal = {Journal of Pharmacokinetics and Biopharmaceutics},
year = {1990},
volume = {18},
pages = {137--144},
}

@article{Owen65,
author = {Owen, D. B.},
title = "{A special case of a bivariate non-central $t$-distribution}",
journal = {Biometrika},
volume = {52},
pages = {437--446},
year = {1965},
}
Loading

0 comments on commit 399acf1

Please sign in to comment.