Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
stephaneguerrier committed May 2, 2024
1 parent f49ac4c commit 32c0d13
Show file tree
Hide file tree
Showing 30 changed files with 557 additions and 327 deletions.
117 changes: 104 additions & 13 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ always_allow_html: yes
<!-- README.md is generated from README.Rmd. Please edit this file -->

```{r, include = FALSE, cache = FALSE}
library(cTOST)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
Expand All @@ -34,34 +35,124 @@ asciicast::init_knitr_engine(
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/cTOST)](https://www.r-pkg.org/pkg/cTOST)
<!-- badges: end -->

## `cTOST` Overview
## 1. `cTOST` Overview

This R package contains the functions to test equivalence in univariate and multivariate settings based on the Two One-Sided Tests (TOST). In addition, the package contains different corrective procedures applied to the standard TOST in order to adjust the size of the procedure at the desired nominal level leading to more powerful procedures. This package implements the $\alpha$-TOST and $\delta$-TOST methods proposed in Boulaguiem et al. (2024a) and in Boulaguiem et al. (2024b).
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.

## Install Instructions
## 2. Install Instructions

The `cTOST` package is available on GitHub at the moment. It is subject to ongoing updates that may lead to stability issues.
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.

In order to install the package, it is required to pre-install the `devtools` dependency. Run the following command if you do not have it already installed:
The package can from cran as follows:

```{r, eval=FALSE}
install.packages("devtools")
```{r, eval = F}
install.packages("cTOST")
```

The package is then installed with the following command:
The package can also be install from GitHub using the `devtools` package:

```{r, eval=FALSE}
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](https://cran.r-project.org/bin/windows/Rtools/).

## How to use
## 3. How to use

We provide here a few examples on the usage of the `cTOST` package. More information can be found here: ???

### 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:

```{r}
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:

```{r, eval = F}
stost = tost(theta = theta_hat, sigma = sig_hat, nu = nu, delta = log(1.25))
stost
```

```{asciicast}
library(cTOST)
data(skin)
theta_hat = diff(apply(skin,2,mean))
nu = nrow(skin) - 1
sig_hat = sd(apply(skin,1,diff))/sqrt(nu)
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:

```{r, eval = F}
atost = ctost(theta = theta_hat, sigma = sig_hat, nu = nu,
delta = log(1.25), method = "alpha")
atost
```

```{asciicast}
library(cTOST)
data(skin)
theta_hat = diff(apply(skin,2,mean))
nu = nrow(skin) - 1
sig_hat = sd(apply(skin,1,diff))/sqrt(nu)
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:

```{r, eval = F}
compare_to_tost(atost)
```

```{asciicast}
library(cTOST)
data(skin)
theta_hat = diff(apply(skin,2,mean))
nu = nrow(skin) - 1
sig_hat = sd(apply(skin,1,diff))/sqrt(nu)
atost = ctost(theta = theta_hat, sigma = sig_hat, nu = nu, delta = log(1.25), method = "alpha")
compare_to_tost(atost)
```

### 3.1.3. $\delta$-TOST

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

```{r}
dtost = ctost(theta = theta_hat, sigma = sig_hat, nu = nu,
delta = log(1.25), method = "delta")
dtost
```

```{asciicast}
library(cTOST)
data(skin)
theta_hat = diff(apply(skin,2,mean))
nu = nrow(skin) - 1
sig_hat = sd(apply(skin,1,diff))/sqrt(nu)
dtost = ctost(theta = theta_hat, sigma = sig_hat, nu = nu, delta = log(1.25), method = "delta")
dtost
```

TO DO
### 3.2. Multivariate settings

COMING SOON

## How to cite
## 4. How to cite

```{}
@Manual{boulaguiem2024ctost,
Expand All @@ -73,11 +164,11 @@ TO DO
}
```

## License
## 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](https://www.gnu.org/licenses/agpl-3.0.en.html) which will provide a synopsis of the restrictions placed upon the code.

## References
## 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]( https://doi.org/10.1002/sim.9993).

Expand Down
113 changes: 92 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,115 @@ downloads](http://cranlogs.r-pkg.org/badges/cTOST)](https://www.r-pkg.org/pkg/cT
downloads](https://cranlogs.r-pkg.org/badges/grand-total/cTOST)](https://www.r-pkg.org/pkg/cTOST)
<!-- badges: end -->

## `cTOST` Overview
## 1. `cTOST` Overview

This R package contains the functions to test equivalence in univariate
and multivariate settings based on the Two One-Sided Tests (TOST). In
addition, the package contains different corrective procedures applied
to the standard TOST in order to adjust the size of the procedure at the
desired nominal level leading to more powerful procedures. This package
implements the $\alpha$-TOST and $\delta$-TOST methods proposed in
Boulaguiem et al. (2024a) and in Boulaguiem et al. (2024b).
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.

## Install Instructions
## 2. Install Instructions

The `cTOST` package is available on GitHub at the moment. It is subject
to ongoing updates that may lead to stability issues.
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.

In order to install the package, it is required to pre-install the
`devtools` dependency. Run the following command if you do not have it
already installed:
The package can from cran as follows:

``` r
install.packages("devtools")
install.packages("cTOST")
```

The package is then installed with the following command:
The package can also be install from GitHub using the `devtools`
package:

``` r
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](https://cran.r-project.org/bin/windows/Rtools/).

## How to use
## 3. How to use

We provide here a few examples on the usage of the `cTOST` package. More
information can be found here: ???

### 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:

``` r
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:

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

<img src="README_files/figure-gfm//unnamed-chunk-6.svg" width="100%" />

#### 3.1.2. $\alpha$-TOST

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

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

<img src="README_files/figure-gfm//unnamed-chunk-8.svg" width="100%" />

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

``` r
compare_to_tost(atost)
```

<img src="README_files/figure-gfm//unnamed-chunk-10.svg" width="100%" />

### 3.1.3. $\delta$-TOST

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

``` r
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
```

<img src="README_files/figure-gfm//unnamed-chunk-12.svg" width="100%" />

### 3.2. Multivariate settings

TO DO
COMING SOON

## How to cite
## 4. How to cite

@Manual{boulaguiem2024ctost,
title = {cTOST: Finite Sample Correction of The TOST in The Univariate Framework},
Expand All @@ -61,15 +132,15 @@ TO DO
url = {https://github.com/stephaneguerrier},
}

## License
## 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](https://www.gnu.org/licenses/agpl-3.0.en.html) which will provide
a synopsis of the restrictions placed upon the code.

## References
## 6. References

Boulaguiem, Y., Quartier, J., Lapteva, M., Kalia, Y. N., Victoria-Feser,
M. P., Guerrier, S. & Couturier, D. L., “*Finite Sample Adjustments for
Expand Down
2 changes: 1 addition & 1 deletion README_files/figure-gfm/unnamed-chunk-10.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 32c0d13

Please sign in to comment.