Skip to content

Commit d6d3a9e

Browse files
author
NightlordTW
committed
Add testing of multiple primary endpoints
1 parent dabf3fc commit d6d3a9e

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

vignettes/sampleSize_parallel_2A3E.Rmd

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,52 @@ If correlations differ between endpoints, they can be specified individually usi
200200

201201
Referring to the output above, the required sample size for this setting is `r N_mult_corr$response$n_total`. This is `r N_ss$response$n_total - N_mult_corr$response$n_total` fewer patients than the scenario where the endpoints are assumed to be uncorrelated.
202202

203+
# Simultaneous Testing of Independent Primary Endpoints
204+
Consider now we are interested in demonstrating equivalence for at least $k=1$ of the $m=3$ primary endpoints. Unlike the previous cases, where equivalence was required for all endpoints, this setting necessitates an adjustment for multiplicity to control the family-wise error rate.
203205

206+
```{r}
207+
(N_mp_bon <- sampleSize(
208+
power = 0.9, # Target power
209+
alpha = 0.05, # Significance level
210+
mu_list = mu_list, # List of means
211+
sigma_list = sigma_list, # List of standard deviations
212+
list_comparator = list_comparator, # Comparator configurations
213+
list_lequi.tol = list_lequi.tol, # Lower equivalence boundaries
214+
list_uequi.tol = list_uequi.tol, # Upper equivalence boundaries
215+
rho = 0.6, # Correlation between endpoints
216+
dtype = "parallel", # Trial design type
217+
ctype = "ROM", # Test type (Ratio of Means)
218+
vareq = TRUE, # Assume equal variances
219+
lognorm = TRUE, # Log-normal distribution assumption
220+
k = 1, # Reject at least one null hypothesis
221+
adjust = "bon", # Bonferroni adjustment method
222+
ncores = 1, # Number of cores for computation
223+
nsim = 1000, # Number of stochastic simulations
224+
seed = 1234 # Random seed for reproducibility
225+
))
226+
```
227+
As mentioned in [the Introduction](../articles/intopkg.html), the Bonferroni correction is often overly conservative, especially in scenarios with correlated tests. A less restrictive alternative is the *k*-adjustment, which specifically accounts for the number of tests and the number of endpoints required for equivalence.
204228

229+
```{r}
230+
(N_mp_k <- sampleSize(
231+
power = 0.9, # Target power
232+
alpha = 0.05, # Significance level
233+
mu_list = mu_list, # List of means
234+
sigma_list = sigma_list, # List of standard deviations
235+
list_comparator = list_comparator, # Comparator configurations
236+
list_lequi.tol = list_lequi.tol, # Lower equivalence boundaries
237+
list_uequi.tol = list_uequi.tol, # Upper equivalence boundaries
238+
rho = 0.6, # Correlation between endpoints
239+
dtype = "parallel", # Trial design type
240+
ctype = "ROM", # Test type (Ratio of Means)
241+
vareq = TRUE, # Assume equal variances
242+
lognorm = TRUE, # Log-normal distribution assumption
243+
k = 1, # Reject at least one null hypothesis
244+
adjust = "k", # Adjustment method
245+
ncores = 1, # Number of cores for computation
246+
nsim = 1000, # Number of stochastic simulations
247+
seed = 1234 # Random seed for reproducibility
248+
))
249+
```
205250

206251
# References

0 commit comments

Comments
 (0)