You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vignettes/sampleSize_parallel_2A3E.Rmd
+45Lines changed: 45 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -200,7 +200,52 @@ If correlations differ between endpoints, they can be specified individually usi
200
200
201
201
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.
202
202
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.
203
205
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
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.
204
228
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
0 commit comments