Skip to content

Commit fe94a72

Browse files
author
NightlordTW
committed
add library
1 parent 81baa4d commit fe94a72

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

vignettes/sampleSize_parallel_2A3E.Rmd

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ The null hypothesis ($H_0$) is rejected if, and only if, all null hypotheses ass
8989
If each pharmacokinetic (PK) measure is tested independently, the following sample sizes would be required for each endpoint to achieve a 5\% significance level:
9090

9191
```{r}
92+
library(SimTOST)
93+
9294
# Sample size calculation for AUCinf
9395
(sim_AUCinf <- sampleSize(
9496
power = 0.9, # Target power
@@ -97,15 +99,29 @@ If each pharmacokinetic (PK) measure is tested independently, the following samp
9799
list_comparator = list("EMA" = c("SB2", "EU_Remicade")), # Comparator configuration
98100
mu_list = list("SB2" = 38703, "EU_Remicade" = 39360), # Mean values
99101
sigma_list = list("SB2" = 11114, "EU_Remicade" = 12332), # Standard deviation values
100-
list_lequi.tol = list("EMA" = 0.8), # Lower equivalence margin
101-
list_uequi.tol = list("EMA" = 1 / 0.8), # Upper equivalence margin
102+
list_lequi.tol = list("EMA" = 0.80), # Lower equivalence margin
103+
list_uequi.tol = list("EMA" = 1.25), # Upper equivalence margin
104+
ncores = 1, # Number of computation cores
105+
nsim = 1000 # Number of stochastic simulations
106+
))
107+
108+
# Sample size calculation for AUClast
109+
(sim_AUClast <- sampleSize(
110+
power = 0.9, # Target power
111+
alpha = 0.05, # Significance level
112+
arm_names = c("SB2", "EU_Remicade"), # Names of trial arms
113+
list_comparator = list("EMA" = c("SB2", "EU_Remicade")), # Comparator configuration
114+
mu_list = list("SB2" = 36862, "EU_Remicade" = 37022), # Mean values
115+
sigma_list = list("SB2" = 9133, "EU_Remicade" = 9398), # Standard deviation values
116+
list_lequi.tol = list("EMA" = 0.80), # Lower equivalence margin
117+
list_uequi.tol = list("EMA" = 1.25), # Upper equivalence margin
102118
ncores = 1, # Number of computation cores
103119
nsim = 1000 # Number of stochastic simulations
104120
))
105121
```
106122

107123

108-
If we were to test each PK measure independently, we would find a total sample size of $N=$ `r sim_AUCinf$sim_AUCinf$response$n_total` for AUCinf, $N=56$ for AUClast, and $N=20$ for Cmax. This means that we would have to enroll `r sim_AUCinf$sim_AUCinf$response$n_total` + $56+20 = 152$ patients in order to reject $H_0$ at a significance level of 5\%.
124+
If we were to test each PK measure independently, we would find a total sample size of `r sim_AUCinf$response$n_total` for AUCinf, `r sim_AUClast$response$n_total` for AUClast, and $N=20$ for Cmax. This means that we would have to enroll `r sim_AUCinf$response$n_total` + `r sim_AUClast$response$n_total` +$20 = 152$ patients in order to reject $H_0$ at a significance level of 5\%.
109125

110126

111127

vignettes/sampleSize_parallel_3A1E.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ list_uequi.tol <- list("EMA" = 1/0.8, "FDA" = 1/0.8) # Upper equivalence boundar
141141
We then pass these values into the [sampleSize()](../reference/sampleSize.html) function to calculate the required sample size for multiple comparisons.
142142

143143
```{r}
144-
AUCinf_2comp <- sampleSize(
144+
(AUCinf_2comp <- sampleSize(
145145
power = 0.9, # Target power
146146
alpha = 0.05, # Confidence level
147147
arm_names = data$arm, # Names of trial arms
@@ -152,9 +152,7 @@ AUCinf_2comp <- sampleSize(
152152
list_uequi.tol = list_uequi.tol, # Upper equivalence boundary
153153
ncores = 1, # Number of cores for computation
154154
nsim = 1000 # Number of stochastic simulations
155-
)
156-
157-
AUCinf_2comp
155+
))
158156
```
159157

160158
## Results and Interpretation

0 commit comments

Comments
 (0)