Skip to content

Commit 67a95f5

Browse files
author
NightlordTW
committed
Add testing of primary endpoints
1 parent d6d3a9e commit 67a95f5

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

vignettes/sampleSize_parallel_2A3E.Rmd

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ 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
203+
# Simultaneous Testing of Correlated Primary Endpoints
204204
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.
205205

206206
```{r}
@@ -248,4 +248,35 @@ As mentioned in [the Introduction](../articles/intopkg.html), the Bonferroni cor
248248
))
249249
```
250250

251+
A more advanced testing approach involves Sequential Adjustment, where the significance level is adjusted separately for groups of endpoints (primary and secondary). A Bonferroni adjustment is applied to the primary endpoints based on their number. If the null hypothesis for the primary endpoints is rejected, testing proceeds sequentially to the secondary endpoints, which are also Bonferroni-adjusted based on the number of secondary endpoints.
252+
253+
In this example, the sequential adjustment can be implemented by setting the function argument to `adjust = "seq"` and specifying the type of each endpoint through the `type_y` parameter. For instance, we define "AUCinf" as a primary endpoint, while "AUClast" and "Cmax" are designated as secondary endpoints.
254+
255+
256+
```{r}
257+
(N_mp_seq <- sampleSize(
258+
power = 0.9, # Target power
259+
alpha = 0.05, # Significance level
260+
mu_list = mu_list, # List of means
261+
sigma_list = sigma_list, # List of standard deviations
262+
list_comparator = list_comparator, # Comparator configurations
263+
list_lequi.tol = list_lequi.tol, # Lower equivalence boundaries
264+
list_uequi.tol = list_uequi.tol, # Upper equivalence boundaries
265+
rho = 0.6, # Correlation between endpoints
266+
dtype = "parallel", # Trial design type
267+
ctype = "ROM", # Test type (Ratio of Means)
268+
vareq = TRUE, # Assume equal variances
269+
lognorm = TRUE, # Log-normal distribution assumption
270+
k = 1, # Reject at least one null hypothesis
271+
adjust = "seq", # Sequential adjustment method
272+
type_y = c("AUCinf" = 1, "AUClast" = 2, "Cmax" = 2), # Endpoint types
273+
ncores = 1, # Number of cores for computation
274+
nsim = 1000, # Number of stochastic simulations
275+
seed = 1234 # Random seed for reproducibility
276+
))
277+
```
278+
279+
280+
281+
251282
# References

0 commit comments

Comments
 (0)