Skip to content

Commit 1b3a83f

Browse files
author
NightlordTW
committed
Add new example
1 parent af003d0 commit 1b3a83f

File tree

4 files changed

+76
-1
lines changed

4 files changed

+76
-1
lines changed

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ simParallelEndpoints <- function(n,
5959
#'
6060
power_cal <- function(n,nsim,param,param.d,seed,ncores){
6161

62-
if(param.d$dtype == "parallel"){
62+
if (param.d$dtype == "parallel") {
6363
TAR_used <- unlist(param$TAR_list)[unique(unlist(param$list_comparator))]
6464
size <- ceiling(n*TAR_used)
6565
size[size < 2] <- 2

README.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The main features of this package is `sampleSize` function which can be used to
4747
|------------------------------------------------|--------------|---------------------|--------------------------|
4848
| [Bioequivalence Tests for Parallel Trial Designs with Log-Normal Data](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_parallel.html) | Parallel | 2 | Multiple (e.g., 2 or 3) |
4949
| [Bioequivalence Tests for 2x2 Cross-Over Trial Designs with Log-Normal Data](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_crossover.html) | Cross-over | 2 | 2 |
50+
| [Bioequivalence Tests for Parallel Trial Designs: 2 Arms, 1 Endpoint](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_parallel_2A1E.html) | Parallel | 2 | 1 |
5051
| [Bioequivalence Tests for Parallel Trial Designs: 3 Arms, 1 Endpoint](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_parallel_3A1E.html) | Parallel | 3 | 1 |
5152
| [Bioequivalence Tests for Parallel Trial Designs: 2 Arms, 3 Endpoints](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_parallel_2A3E.html) | Parallel | 2 | 3 |
5253
| [Bioequivalence Tests for Parallel Trial Designs: 3 Arms, 3 Endpoints](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_parallel_3A3E.html) | Parallel | 3 | 3 |

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Various worked examples are available as
4343
|----|----|----|----|
4444
| [Bioequivalence Tests for Parallel Trial Designs with Log-Normal Data](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_parallel.html) | Parallel | 2 | Multiple (e.g., 2 or 3) |
4545
| [Bioequivalence Tests for 2x2 Cross-Over Trial Designs with Log-Normal Data](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_crossover.html) | Cross-over | 2 | 2 |
46+
| [Bioequivalence Tests for Parallel Trial Designs: 2 Arms, 1 Endpoint](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_parallel_2A1E.html) | Parallel | 2 | 1 |
4647
| [Bioequivalence Tests for Parallel Trial Designs: 3 Arms, 1 Endpoint](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_parallel_3A1E.html) | Parallel | 3 | 1 |
4748
| [Bioequivalence Tests for Parallel Trial Designs: 2 Arms, 3 Endpoints](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_parallel_2A3E.html) | Parallel | 2 | 3 |
4849
| [Bioequivalence Tests for Parallel Trial Designs: 3 Arms, 3 Endpoints](https://smartdata-analysis-and-statistics.github.io/SimTOST/articles/sampleSize_parallel_3A3E.html) | Parallel | 3 | 3 |
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: "Bioequivalence Tests for Parallel Trial Designs: 2 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: 2 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+
# Introduction
26+
27+
28+
## Difference of Means Test
29+
This example, adapted from Example 1 in the PASS manual chapter titled *"Biosimilarity Tests for the Difference Between Means Using a Parallel Two-Group Design"*, illustrates the process of planning a clinical trial to assess biosimilarity. Specifically, the trial aims to compare blood pressure outcomes between two groups.
30+
31+
### Scenario
32+
Drug B is a well-established biologic drug used to control blood pressure. Its exclusive marketing license has expired, creating an opportunity for other companies to develop biosimilars. Drug A is a new competing drug being developed as a potential biosimilar to Drug B. The goal is to determine whether Drug A meets FDA biosimilarity requirements in terms of safety, purity, and therapeutic response when compared to Drug B.
33+
34+
### Trial Design
35+
The study follows a parallel-group design with the following key assumptions:
36+
37+
* Reference Group (Drug B): The average blood pressure is 96 mmHg, with a within-group standard deviation of 18 mmHg.
38+
* Mean Difference: As per FDA guidelines, the assumed difference between the two groups is set to $\delta = \sigma/8 = 2.25$ mmHg.
39+
* Biosimilarity Limits: These are defined as ±1.5σ = ±27 mmHg, ensuring compliance with regulatory requirements.
40+
* Type-I Error Rate: A one-sided α=0.025 is specified.
41+
* Desired Power: The target power for the study is 90%
42+
43+
To implement these parameters in R, the following code snippet can be used:
44+
45+
```r
46+
# Reference group mean blood pressure (Drug B)
47+
mu_r <- setNames(96, "BP")
48+
49+
# Treatment group mean blood pressure (Drug A)
50+
mu_t <- setNames(96 + 2.25, "BP")
51+
52+
# Common within-group standard deviation
53+
sigma <- setNames(18, "BP")
54+
55+
# Lower and upper biosimilarity limits
56+
lequi_lower <- setNames(-27, "BP")
57+
lequi_upper <- setNames(27, "BP")
58+
```
59+
60+
### Objective
61+
To explore the power of the test across a range of group sample sizes, the researchers plan to calculate the power for group sizes varying from 6 to 20. These calculations will use the noncentral t-distribution to evaluate the ability of the study design to detect the specified difference and meet biosimilarity criteria.
62+
63+
64+
```r
65+
sampleSize(power = 0.86, alpha = 0.025,
66+
mu_list = list("R" = mu_r, "T" = mu_t),
67+
sigma_list = list("R" = sigma, "T" = sigma),
68+
list_comparator = list("T_vs_R" = c("R", "T")),
69+
list_lequi.tol = list("T_vs_R" = lequi_lower),
70+
list_uequi.tol = list("T_vs_R" = lequi_upper),
71+
dtype = "parallel", ctype = "DOM", lognorm = FALSE,
72+
adjust = "no", ncores = 1, nsim = 1000, seed = 1234)
73+
```

0 commit comments

Comments
 (0)