Skip to content

Commit 3a70f5e

Browse files
author
NightlordTW
committed
Epand vignette
1 parent 880651d commit 3a70f5e

File tree

2 files changed

+113
-12
lines changed

2 files changed

+113
-12
lines changed

vignettes/intopkg.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ One possible solution, if the required sample size is not feasible, is to power
114114

115115
## Testing multiple primary endpoints
116116

117-
When a trial aims to evaluate equivalence for at least $k$ out of $m$ primary endpoints, multiple tests are required. The total number of tests depends on the approach used to evaluate equivalence. For example, with $m=3$ independent primary endpoints and a significance level of $\alpha = 5\%$, the probability of making a Type I error on at least one hypothesis test is:
117+
When a trial aims to evaluate equivalence for at least $k$ out of $m$ primary endpoints, adjustments must be made to account for the increased probability of Type I errors due to multiple hypothesis testing. For example, with $m=3$ independent primary endpoints and a significance level of $\alpha = 5\%$, the probability of making a Type I error on at least one hypothesis test is:
118118

119119
$$ 1 – (1-\alpha)^m = 1 - (1-0.05)^3 = 0.1426. $$
120120
This means that the overall probability of making any false positive error, also known as the **family-wise error rate (FWER)**, increases to approximately 14%.

vignettes/sampleSize_parallel_3A3E.Rmd

Lines changed: 112 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Similar to the example presented in [Bioequivalence Tests for Parallel Trial Des
2727

2828
In many studies, it is necessary to evaluate equivalence across multiple primary variables. For example, the European Medicines Agency (EMA) recommends demonstrating equivalence for both the Area Under the Curve (AUC) and the maximum concentration (Cmax) when assessing pharmacokinetic properties. However, in this case, we evaluate equivalence across three treatment arms, including a test biosimilar and two reference products, each sourced from a different regulatory region.
2929

30-
This vignette demonstrates advanced techniques for calculating sample size in such trials, where both multiple endpoints and multiple reference products are considered. As an illustrative example, we use data from the phase-1 trial [NCT01922336](https://clinicaltrials.gov/study/NCT01922336#study-overview), which assessed pharmacokinetics following a single dose of SB2, its EU-sourced reference product (EU_Remicade), and its US-sourced reference product (USA_Remicade) [@shin_randomized_2015].
30+
This vignette demonstrates advanced techniques for calculating sample size in such trials, where both multiple endpoints and multiple reference products are considered. As an illustrative example, we use data from the phase-1 trial [NCT01922336](https://clinicaltrials.gov/study/NCT01922336#study-overview), which assessed pharmacokinetics following a single dose of SB2, its EU-sourced reference product (EU-INF), and its US-sourced reference product (US-INF) [@shin_randomized_2015].
3131

3232
```{r inputdata, echo=FALSE}
3333
@@ -64,15 +64,15 @@ Below is the R code to define the required data:
6464
# Mean values for each endpoint and arm
6565
mu_list <- list(
6666
SB2 = c(AUCinf = 38703, AUClast = 36862, Cmax = 127.0),
67-
EUREF = c(AUCinf = 39360, AUClast = 37022, Cmax = 126.2),
68-
USREF = c(AUCinf = 39270, AUClast = 37368, Cmax = 129.2)
67+
EUINF = c(AUCinf = 39360, AUClast = 37022, Cmax = 126.2),
68+
USINF = c(AUCinf = 39270, AUClast = 37368, Cmax = 129.2)
6969
)
7070
7171
# Standard deviation values for each endpoint and arm
7272
sigma_list <- list(
7373
SB2 = c(AUCinf = 11114, AUClast = 9133, Cmax = 16.9),
74-
EUREF = c(AUCinf = 12332, AUClast = 9398, Cmax = 17.9),
75-
USREF = c(AUCinf = 10064, AUClast = 8332, Cmax = 18.8)
74+
EUINF = c(AUCinf = 12332, AUClast = 9398, Cmax = 17.9),
75+
USINF = c(AUCinf = 10064, AUClast = 8332, Cmax = 18.8)
7676
)
7777
```
7878

@@ -89,26 +89,127 @@ In this example, we aim to demonstrate:
8989
* Bioequivalence of SB2 vs. EU-INF for AUCinf and Cmax, and
9090
* Bioequivalence of SB2 vs. US-INF for AUClast and Cmax.
9191

92+
The comparisons can be specified as follows:
93+
94+
```{r}
95+
# Arms to be compared
96+
list_comparator <- list(
97+
EMA = c("SB2", "EUINF"),
98+
FDA = c("SB2", "USINF")
99+
)
100+
101+
# Endpoints to be compared
102+
list_y_comparator <- list(
103+
EMA = c("AUCinf", "Cmax"),
104+
FDA = c("AUClast", "Cmax")
105+
)
106+
```
107+
92108
For all endpoints, bioequivalence is established if the 90% confidence intervals for the ratios of the geometric means fall within the equivalence range of 80.00% to 125.00%.
93109

94110
Below is the R code to define the equivalence boundaries for each comparison:
95111

96112
```{r}
97113
# Define comparators and equivalence boundaries
98114
list_comparator <- list(
99-
"EMA" = c("SB2", "EUREF"),
100-
"FDA" = c("SB2", "USREF")
115+
"EMA" = c("SB2", "EUINF"),
116+
"FDA" = c("SB2", "USINF")
117+
)
118+
119+
list_lequi.tol <- list(
120+
"EMA" = c(AUCinf = 0.8, Cmax = 0.8),
121+
"FDA" = c(AUClast = 0.8, Cmax = 0.8)
122+
)
123+
124+
list_uequi.tol <- list(
125+
"EMA" = c(AUCinf = 1.25, Cmax = 1.25),
126+
"FDA" = c(AUClast = 1.25, Cmax = 1.25)
127+
)
128+
```
129+
130+
Here, the `list_comparator` parameter specifies the arms being compared, while `list_lequi.tol` and `list_uequi.tol` define the lower and upper equivalence boundaries for the endpoints under consideration.
131+
132+
To calculate the required sample size for testing equivalence under the specified conditions, we use the [sampleSize()](../reference/sampleSize.html) function from the SimTOST package. This function computes the total sample size needed to achieve the target power while ensuring equivalence criteria are met.
133+
134+
```{r}
135+
library(SimTOST)
136+
137+
(N_ss <- sampleSize(power = 0.9, # Target power
138+
alpha = 0.05, # Type I error rate
139+
mu_list = mu_list, # Means for each endpoint and arm
140+
sigma_list = sigma_list, # Standard deviations
141+
list_comparator = list_comparator, # Comparator arms
142+
list_y_comparator = list_y_comparator, # Endpoints to compare
143+
list_lequi.tol = list_lequi.tol, # Lower equivalence boundaries
144+
list_uequi.tol = list_uequi.tol, # Upper equivalence boundaries
145+
dtype = "parallel", # Trial design type
146+
ctype = "ROM", # Test type: Ratio of Means
147+
vareq = TRUE, # Assume equal variances
148+
lognorm = TRUE, # Log-normal distribution assumption
149+
ncores = 1, # Number of cores for computation
150+
nsim = 1000, # Number of stochastic simulations
151+
seed = 1234)) # Random seed for reproducibility
152+
```
153+
154+
We find a total sample size of N_ss$response$n_total patients (or `r N_ss$response$n_total/3` per arm) are required to demonstrate equivalence.
155+
156+
# Simultaneous Testing of Independent Primary Endpoints
157+
158+
## Equivalence for At Least 2 of the 3 Endpoints with Bonferroni Adjustment
159+
In this example, we aim to establish equivalence for at least two out of three primary endpoints while accounting for multiplicity using the Bonferroni adjustment. The following assumptions are made:
160+
161+
* Equality of Variances: Variances are assumed to be equal across groups (`vareq = TRUE`).
162+
* Testing Parameter: The Ratio of Means (ROM) is used as the testing parameter (`ctype = "ROM"`).
163+
* Design: A parallel trial design is assumed (`dtype = "parallel"`).
164+
* Distribution: Endpoint data follows a log-normal distribution (`lognorm = TRUE`).
165+
* Correlation: Endpoints are assumed to be independent, with no correlation between them (default `rho = 0`).
166+
* Multiplicity Adjustment: The Bonferroni correction is applied to control for Type I error (`adjust = "bon"`).
167+
* Equivalence Criterion: Equivalence is required for at least two of the three endpoints (`k = 2`).
168+
169+
These settings ensure a robust framework for testing multiple endpoints while maintaining control of the family-wise error rate.
170+
171+
The comparisons and equivalence boundaries can be defined as follows:
172+
173+
```{r}
174+
# Endpoints to be compared for each comparator
175+
list_y_comparator <- list(
176+
EMA = c("AUCinf", "AUClast", "Cmax"),
177+
FDA = c("AUCinf", "AUClast", "Cmax")
101178
)
102179
180+
# Define lower equivalence boundaries for each comparator
103181
list_lequi.tol <- list(
104-
"EMA" = c(AUCinf = 0.8, AUClast = 0.8, Cmax = 0.8),
105-
"FDA" = c(AUCinf = 0.8, AUClast = 0.8, Cmax = 0.8)
182+
EMA = c(AUCinf = 0.8, AUClast = 0.8, Cmax = 0.8),
183+
FDA = c(AUCinf = 0.8, AUClast = 0.8, Cmax = 0.8)
106184
)
107185
186+
# Define upper equivalence boundaries for each comparator
108187
list_uequi.tol <- list(
109-
"EMA" = c(AUCinf = 1.25, AUClast = 1.25, Cmax = 1.25),
110-
"FDA" = c(AUCinf = 1.25, AUClast = 1.25, Cmax = 1.25)
188+
EMA = c(AUCinf = 1.25, AUClast = 1.25, Cmax = 1.25),
189+
FDA = c(AUCinf = 1.25, AUClast = 1.25, Cmax = 1.25)
111190
)
112191
```
113192

193+
194+
```{r}
195+
(N_mp <- sampleSize(power = 0.9, # Target power
196+
alpha = 0.05, # Type I error rate
197+
mu_list = mu_list, # Means for each endpoint and arm
198+
sigma_list = sigma_list, # Standard deviations
199+
list_comparator = list_comparator, # Comparator arms
200+
list_y_comparator = list_y_comparator, # Endpoints to compare
201+
list_lequi.tol = list_lequi.tol, # Lower equivalence boundaries
202+
list_uequi.tol = list_uequi.tol, # Upper equivalence boundaries
203+
k = 2, # Number of endpoints to be equivalent
204+
adjust = "bon", # Bonferroni adjustment
205+
dtype = "parallel", # Trial design type
206+
ctype = "ROM", # Test type: Ratio of Means
207+
vareq = TRUE, # Assume equal variances
208+
lognorm = TRUE, # Log-normal distribution assumption
209+
ncores = 1, # Number of cores for computation
210+
nsim = 1000, # Number of stochastic simulations
211+
seed = 1234)) # Random seed for reproducibility
212+
```
213+
214+
114215
# References

0 commit comments

Comments
 (0)