From ae76632a996db00e42beb286dcfa402e5bbeee8f Mon Sep 17 00:00:00 2001 From: Thomas Debray <117118104+tdebray123@users.noreply.github.com> Date: Mon, 18 Nov 2024 21:16:17 +0100 Subject: [PATCH] Fix example in vignette Multiple Correlated Co-Primary Endpoints --- vignettes/sampleSize_crossover.Rmd | 6 +++--- vignettes/sampleSize_parallel.Rmd | 19 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/vignettes/sampleSize_crossover.Rmd b/vignettes/sampleSize_crossover.Rmd index f27ad44..3171efa 100644 --- a/vignettes/sampleSize_crossover.Rmd +++ b/vignettes/sampleSize_crossover.Rmd @@ -1,5 +1,5 @@ --- -title: "Bioequivalence Tests in a 2x2 Cross-Over Design" +title: "Bioequivalence Tests for 2x2 Cross-Over Trial Designs with Log-Normal Data" author: "Thomas Debray" date: "`r format(Sys.time(), '%B %d, %Y')`" output: @@ -8,7 +8,7 @@ output: fig_width: 9 fig_height: 6 vignette: > - %\VignetteIndexEntry{Bioequivalence Tests in a 2x2 Cross-Over Design} + %\VignetteIndexEntry{Bioequivalence Tests for 2x2 Cross-Over Trial Designs with Log-Normal Data} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} bibliography: 'references.bib' @@ -29,7 +29,7 @@ In the examples below, we illustrate the use of `SimTOST` for 2x2 cross-over tri library(SimTOST) ``` -# Bioequivalence Tests for AUC and Cmax (Log-Normal Data) +# Bioequivalence Tests for AUC and Cmax In the first example, we consider Example 1 from the PASS Sample Size Software [Chapter 351](https://www.ncss.com/wp-content/themes/ncss/pdf/Procedures/PASS/Bioequivalence_Tests_for_AUC_and_Cmax_in_a_2x2_Cross-Over_Design-Log-Normal_Data.pdf). We aim to estimate the sample size required to demonstrate bioequivalence between a test and reference product for two pharmacokinetic parameters: the area under the curve (AUC) and the maximum concentration (Cmax). We assume a 2x2 cross-over design. The true ratio of the test to the reference product is assumed to be 1.02 for AUC and 1.03 for Cmax. Based on previous experiments, it is assumed that the standard deviation for $\log(AUC)$ = 0.25 and the standard deviation for $\log(Cmax = 0.3)$. The equivalence limits for the means ratio are set at 0.80 and 1.25. The significance level is set to 5\%, and the sample size is calculated to achieve 80\% power. Additionally, the correlation between AUC and Cmax is assumed to be 0.25. A difference-of-means test on the log scale is employed to determine bioequivalence. In the PASS software, this scenario yielded a total sample size of $n=37$ patients. In **SimTOST**, we can estimate the sample size using the [sampleSize()](../reference/sampleSize.html) function. diff --git a/vignettes/sampleSize_parallel.Rmd b/vignettes/sampleSize_parallel.Rmd index 4bbfa6a..03780b4 100644 --- a/vignettes/sampleSize_parallel.Rmd +++ b/vignettes/sampleSize_parallel.Rmd @@ -1,5 +1,5 @@ --- -title: "Bioequivalence Tests in a Parallel Trial Design" +title: "Bioequivalence Tests for Parallel Trial Designs with Log-Normal Data" author: "Thomas Debray" date: "`r format(Sys.time(), '%B %d, %Y')`" output: @@ -8,7 +8,7 @@ output: fig_width: 9 fig_height: 6 vignette: > - %\VignetteIndexEntry{Bioequivalence Tests in a Parallel Trial Design} + %\VignetteIndexEntry{Bioequivalence Tests for Parallel Trial Designs with Log-Normal Data} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} bibliography: 'references.bib' @@ -22,8 +22,7 @@ options(rmarkdown.html_vignette.check_title = FALSE) #title of doc does not matc doc.cache <- T #for cran; change to F ``` - -In the examples below, we demonstrate the use of **SimTOST** for parallel trial designs. To begin, we first load the package. +In the following examples, we demonstrate the use of **SimTOST** for parallel trial designs with data assumed to follow a normal distribution on the log scale. We start by loading the package. ```{r, echo = T, message=F} library(SimTOST) @@ -78,7 +77,7 @@ In the first approach, we calculate the required sample size for 80% power using ```{r, eval = TRUE} ssMielke <- sampleSize_Mielke(power = 0.8, Nmax = 1000, m = 5, k = 5, rho = 0.8, - sigma = 0.3, true.diff = log(1.05), + sigma = 0.3, true.diff = log(1.05), equi.tol = log(1.25), design = "parallel", alpha = 0.05, adjust = "no", seed = 1234, nsim = 10000) @@ -90,11 +89,11 @@ For 80\% power, `r ssMielke["SS"]` subjects per sequence (`r ssMielke["SS"] * 2` Alternatively, the sample size calculation can be performed using the [sampleSize()](../reference/sampleSize.html) function. This method assumes that effect sizes are normally distributed on the log scale and uses a difference-of-means test (`ctype = "DOM"`) with user-specified values for `mu_list`, `sigma_list`, and the correlation `rho`. ```{r} -mu_r <- c(AUC = log(1.00), Cmax = log(1.00)) -mu_t <- c(AUC = log(1.02), Cmax = log(1.03)) -sigma <- c(AUC = 0.25, Cmax = 0.3) -lequi_lower <- c(AUC = log(0.80), Cmax = log(0.80)) -lequi_upper <- c(AUC = log(1.25), Cmax = log(1.25)) +mu_r <- setNames(rep(log(1.00), 5), paste0("y", 1:5)) +mu_t <- setNames(rep(log(1.05), 5), paste0("y", 1:5)) +sigma <- setNames(rep(0.3, 5), paste0("y", 1:5)) +lequi_lower <- setNames(rep(log(0.8), 5), paste0("y", 1:5)) +lequi_upper <- setNames(rep(log(1.25), 5), paste0("y", 1:5)) ss <- sampleSize(power = 0.8, alpha = 0.05, mu_list = list("R" = mu_r, "T" = mu_t),