|
| 1 | +--- |
| 2 | +title: "Bioequivalence Tests for Parallel Trial Designs: 3 Arms, 1 Endpoint" |
| 3 | +author: "Thomas Debray" |
| 4 | +date: "`r format(Sys.time(), '%B %d, %Y')`" |
| 5 | +output: |
| 6 | + html_document: |
| 7 | + fig_caption: yes |
| 8 | + fig_width: 9 |
| 9 | + fig_height: 6 |
| 10 | +vignette: > |
| 11 | + %\VignetteIndexEntry{Bioequivalence Tests for Parallel Trial Designs: 3 Arms, 1 Endpoint} |
| 12 | + %\VignetteEngine{knitr::rmarkdown} |
| 13 | + %\VignetteEncoding{UTF-8} |
| 14 | +bibliography: 'references.bib' |
| 15 | +link-citations: yes |
| 16 | +--- |
| 17 | + |
| 18 | +```{r setup, include=FALSE, message = FALSE, warning = FALSE} |
| 19 | +knitr::opts_chunk$set(echo = TRUE) |
| 20 | +knitr::opts_chunk$set(comment = "#>", collapse = TRUE) |
| 21 | +options(rmarkdown.html_vignette.check_title = FALSE) #title of doc does not match vignette title |
| 22 | +doc.cache <- T #for cran; change to F |
| 23 | +``` |
| 24 | + |
| 25 | +This vignette demonstrates advanced sample size calculation techniques for parallel trial designs involving three arms and one endpoint. Specifically, we calculate the required sample size to test bioequivalence between a new treatment (SB2) and a reference drug (Remicade) administered in two different locations ("EU_Remicade" and "USA_Remicade"). The endpoint of interest is the Area Under the Curve (AUCinf), a commonly used pharmacokinetic measure. |
| 26 | + |
| 27 | +In this example, we assume the endpoint follows a log-normal distribution with equal variances across arms. The goal is to determine the sample size needed to achieve 90\% power while controlling the type I error rate at 5\%. The equivalence margin is defined as $E_L = 80\%$ and $E_U = 125\%$ of the reference mean on the original scale. |
| 28 | + |
| 29 | +The methods presented in this vignette build on fundamental bioequivalence testing concepts and extend them to multi-arm scenarios. These examples provide practical insights for designing robust parallel trials with complex equivalence testing requirements. |
| 30 | + |
| 31 | +For the primary outcome, AUCinf, we assume the data is available on the original scale, including the mean and standard deviation for each arm. This information is organized into a structured data table for further analysis: |
| 32 | + |
| 33 | + |
| 34 | +```{r setup, echo = T, message=F} |
| 35 | +library(SimTOST) |
| 36 | +
|
| 37 | +data <- data.table::data.table(arm = c("SB2","EU_Remicade","USA_Remicade"), |
| 38 | + mean = c(37162.0, 37705.0, 37702.8), |
| 39 | + sd = c(11113.62172, 12332.41615,12113.72)) |
| 40 | +``` |
| 41 | + |
| 42 | +# Sample Size Calculation for AUCinf: Equivalence to EU Remicade |
| 43 | + |
| 44 | +This example demonstrates how to calculate the sample size required when testing the equivalence of SB2 to a reference drug, Remicade, as administered in Europe. The goal is to determine the minimum number of participants needed to ensure adequate power for the equivalence test. |
| 45 | + |
| 46 | +## Hypotheses |
| 47 | + |
| 48 | +Null Hypothesis (No Equivalence): |
| 49 | +$$H_0: \frac{\mu_{SB2}}{\mu_{RemEU}} \le E_L ~~ or~~ \frac{\mu_{SB2}}{\mu_{RemEU}} \ge E_U$$ |
| 50 | + |
| 51 | +Alternative Hypothesis (Equivalence): |
| 52 | + |
| 53 | +$$H_1: E_L<\frac{\mu_{SB2}}{\mu_{RemEU}} < E_U$$ |
| 54 | + |
| 55 | +Here, $E_L$ and $E_U$ represent the lower and upper equivalence margins, respectively. |
| 56 | + |
| 57 | + |
| 58 | +## Preparing the function arguments |
| 59 | + |
| 60 | +To proceed with the sample size calculation, we first need to organize the mean and standard deviation values of each arm (SB2, EU Remicade, USA Remicade) into appropriate lists. |
| 61 | + |
| 62 | +Since this example focuses on a single endpoint, the mean list (`mu_list`) contains three scalar elements corresponding to each arm, and the standard deviation list (`sigma_list`) contains three 1x1 matrix elements. |
| 63 | + |
| 64 | +```{r} |
| 65 | +mu_list <- as.list(data$mean) # Organize mean values into a list |
| 66 | +sigma_list <- as.list(data$sd) # Organize standard deviation values into a list |
| 67 | +``` |
| 68 | + |
| 69 | +Next, we define the comparison parameters, including the lower (`lequi.tol`) and upper (`uequi.tol`) equivalence boundaries, as well as the list of comparators. Since we are only comparing two arms (SB2 and EU Remicade), the list of comparators contains a single element specifying these two arms: |
| 70 | + |
| 71 | +```{r} |
| 72 | +list_comparator <- list("Comparison" = c("SB2","EU_Remicade")) |
| 73 | +list_lequi.tol <- list("Comparison" = 0.8) |
| 74 | +list_uequi.tol <- list("Comparison" = 1/0.8) |
| 75 | +``` |
| 76 | + |
| 77 | +## Computing Sample Size |
| 78 | + |
| 79 | +Finally, we use the [sampleSize()](../reference/sampleSize.html) function to calculate the required sample size based on stochastic simulations of the trial. The function accepts several parameters, such as the desired power, confidence level, and design specifications. By default, it assumes: |
| 80 | + |
| 81 | +* A parallel design, |
| 82 | +* A test based on the rate of means (ROM), |
| 83 | +* Equal variances across arms, |
| 84 | +* A lognormal distribution for the endpoint. |
| 85 | + |
| 86 | + |
| 87 | +```{r} |
| 88 | +AUCinf_1comp <- sampleSize( |
| 89 | + power = 0.9, # Target power |
| 90 | + alpha = 0.05, # Confidence level |
| 91 | + arm_names = data$arm, # Names of trial arms |
| 92 | + list_comparator = list_comparator, # Comparator configuration |
| 93 | + mu_list = mu_list, # Mean values |
| 94 | + sigma_list = sigma_list, # Standard deviation values |
| 95 | + list_lequi.tol = list_lequi.tol, # Lower equivalence boundary |
| 96 | + list_uequi.tol = list_uequi.tol, # Upper equivalence boundary |
| 97 | + ncores = 1, # Number of cores for computation |
| 98 | + nsim = 1000 # Number of stochastic simulations |
| 99 | +) |
| 100 | +
|
| 101 | +AUCinf_1comp |
| 102 | +``` |
| 103 | + |
| 104 | +Based on the table, the required sample size for this trial setting is `r AUCinf_1comp$response$n_total` or `r AUCinf_1comp$response$n_SB2`for each arm. |
| 105 | + |
| 106 | + |
| 107 | +# References |
0 commit comments