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
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.
We provide here a few examples on the usage of the cTOST
package.
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)
The standard TOST can be used as follows:
stost = tost(theta = theta_hat, sigma = sig_hat, nu = nu, delta = log(1.25))
stost
The 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
compare_to_tost(atost)
The 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
data(ticlopidine)
n = nrow(ticlopidine)
p = ncol(ticlopidine)
nu = n-1
theta_hat = colMeans(ticlopidine)
Sigma_hat = cov(ticlopidine)/n
mtost = tost(theta = theta_hat, sigma = Sigma_hat, nu = nu, delta = log(1.25))
mtost
matost = ctost(theta = theta_hat, sigma = Sigma_hat, nu = nu, delta = log(1.25))
matost
@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},
}
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.
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.