Skip to content

Commit af003d0

Browse files
author
NightlordTW
committed
Add drop-out scenario
1 parent 0296761 commit af003d0

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

vignettes/sampleSize_parallel_3A3E.Rmd

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ library(SimTOST)
151151
seed = 1234)) # Random seed for reproducibility
152152
```
153153

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.
154+
We find a total sample size of `r N_ss$response$n_total` patients (or `r N_ss$response$n_total/3` per arm) are required to demonstrate equivalence.
155155

156156
# Simultaneous Testing of Independent Primary Endpoints
157157

@@ -236,8 +236,33 @@ This can be achieved by specifying the treatment allocation rate parameter (`TAR
236236
seed = 1234)) # Random seed for reproducibility
237237
```
238238

239-
Results from the simulation indicate that `r N_mp2$response$n_SB2` patients are required for SB2 the active treatment arm (SB2), and `r N_mp2$response$n_EUINF` patients are required for each reference arm. The total sample size required is `r N_mp2$response$n_total`. This is significantly larger compared to the previous example, where the total sample size was `r N_mp$response$n_total`.
239+
Results from the simulation indicate that `r N_mp2$response$n_SB2` patients are required for SB2 the active treatment arm (SB2), and `r N_mp2$response$n_EUINF` patients are required for each reference arm. The total sample size required is `r N_mp2$response$n_total`, which is larger compared to the trial with an equal allocation ratio, where the total sample size was `r N_mp$response$n_total`.
240240

241+
## Accounting for Dropouts
242+
In the examples above, the sample size calculations assumed that all patients enrolled in the trial would complete it. However, in practice, a certain percentage of participants typically drop out, which can impact the required sample size. To account for this, we consider a 20% dropout rate across all treatment arms in this example.
241243

244+
```{r}
245+
(N_mp3 <- sampleSize(power = 0.9, # Target power
246+
alpha = 0.05, # Type I error rate
247+
mu_list = mu_list, # Means for each endpoint and arm
248+
sigma_list = sigma_list, # Standard deviations
249+
list_comparator = list_comparator, # Comparator arms
250+
list_y_comparator = list_y_comparator, # Endpoints to compare
251+
list_lequi.tol = list_lequi.tol, # Lower equivalence boundaries
252+
list_uequi.tol = list_uequi.tol, # Upper equivalence boundaries
253+
k = 2, # Number of endpoints required to demonstrate equivalence
254+
adjust = "bon", # Bonferroni adjustment for multiple comparisons
255+
TAR = c("SB2" = 2, "EUINF" = 1, "USINF" = 1), # Treatment allocation rates
256+
dropout = c("SB2" = 0.20, "EUINF" = 0.20, "USINF" = 0.20), # Expected dropout rates
257+
dtype = "parallel", # Trial design type (parallel group)
258+
ctype = "ROM", # Test type: Ratio of Means
259+
vareq = TRUE, # Assume equal variances across arms
260+
lognorm = TRUE, # Log-normal distribution assumption
261+
ncores = 1, # Number of cores for computation
262+
nsim = 1000, # Number of stochastic simulations
263+
seed = 1234)) # Random seed for reproducibility
264+
```
265+
266+
Based on the output above, considering a 20% dropout rate, the total sample size required is `r N_mp3$response$n_total`.
242267

243268
# References

0 commit comments

Comments
 (0)