Skip to content

stephaneguerrier/cTOST

Repository files navigation

cTOST Overview

Licence Last-changedate R-CMD-check CRAN RStudio mirror downloads CRAN RStudio mirror downloads

1. cTOST Overview

This R package contains functions for testing equivalence in both univariate and multivariate settings, based on the Two One-Sided Tests (TOST). The cTOST package implements the $\alpha$-TOST and $\delta$-TOST methods proposed by Boulaguiem et al. (2024a, 2024b). These two corrective procedures that can be applied to the standard TOST to adjust the size of the procedure to the desired nominal level, resulting in more powerful procedures.

2. Install Instructions

The cTOST package is available on cran and on GitHub. The version on GitHub is subject to ongoing updates that may lead to stability issues.

The package can from cran as follows:

install.packages("cTOST")

The package can also be install from GitHub using the devtools package:

install.packages("devtools")
devtools::install_github("stephaneguerrier/cTOST")

Note that Windows users are assumed that have Rtools installed (if this is not the case, please visit this link.

3. How to use

We provide here a few examples on the usage of the cTOST package.

3.1. Univariate settings

To illustrate the use of the proposed method in the univariate settings, we consider the skin dataset analyzed in Boulaguiem et al. (2024a), which can be loaded as follows:

data(skin)
theta_hat = diff(apply(skin,2,mean))
nu = nrow(skin) - 1
sig_hat = sd(apply(skin,1,diff))/sqrt(nu)

3.1.1. Standard TOST

The standard TOST can be used as follows:

stost = tost(theta = theta_hat, sigma = sig_hat, nu = nu, delta = log(1.25))
stost

3.1.2. $\alpha$-TOST

The $\alpha$-TOST can be used through the function ctost as follows:

atost = ctost(theta = theta_hat, sigma = sig_hat, nu = nu, 
              delta = log(1.25), method = "alpha")
atost

It is possible to compare the results of the $\alpha$-TOST (or $\delta$-TOST, see below) with the standard TOST as follows:

compare_to_tost(atost)

3.1.3. $\delta$-TOST

The $\delta$-TOST can be used through the function ctost as follows:

dtost = ctost(theta = theta_hat, sigma = sig_hat, nu = nu, 
              delta = log(1.25), method = "delta")
dtost
#> ✖ Can't accept (bio)equivalence
#> Corr. Equiv. Region:  |----------------0----------------|
#>       Estim. Inter.:     (--------------x---------------)
#> CI =  (-0.21174 ; 0.25715)
#> 
#> Method: delta-TOST
#> alpha = 0.05; Equiv. lim. = +/- 0.22314
#> Corrected Equiv. lim. = +/- 0.25473
#> Mean = 0.02270; Stand. dev. = 0.13428; df = 16

3.2. Multivariate settings

data(ticlopidine)
n = nrow(ticlopidine)
p = ncol(ticlopidine)
nu = n-1
theta_hat = colMeans(ticlopidine)
Sigma_hat = cov(ticlopidine)/n

3.2.1. Multivariate TOST

mtost = tost(theta = theta_hat, sigma = Sigma_hat, nu = nu, delta = log(1.25))
mtost

3.2.2. Multivariate $\alpha$-TOST

matost = ctost(theta = theta_hat, sigma = Sigma_hat, nu = nu, delta = log(1.25))
matost

4. How to cite

@Manual{boulaguiem2024ctost,
  title = {cTOST: Finite Sample Correction of The TOST in The Univariate Framework},
  author = {Boulaguiem, Y. and Insolia, L. and Couturier, D.-L. and Guerrier, S.},
  year = {2024},
  note = {R package version 1.1.0},
  url = {https://github.com/stephaneguerrier},
}

5. License

The license this source code is released under is the GNU AFFERO GENERAL PUBLIC LICENSE (AGPL) v3.0. Please see the LICENSE file for full text. Otherwise, please consult GNU which will provide a synopsis of the restrictions placed upon the code.

6. References

Boulaguiem, Y., Quartier, J., Lapteva, M., Kalia, Y. N., Victoria-Feser, M. P., Guerrier, S. & Couturier, D. L., “Finite Sample Adjustments for Average Equivalence Testing”, Statistics in Medicine, 2024a, https://doi.org/10.1002/sim.9993.

Boulaguiem, Y., Insolia, L., Victoria-Feser, M. P., Couturier, D. L. & Guerrier, S., “Multivariate Adjustments for Average Equivalence Testing”, submitted manuscript, 2024b.

About

Finite sample correction methods for equivalence testing procedures

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published