Skip to content

Commit 2cce4ea

Browse files
author
NightlordTW
committed
Complete example
1 parent 1b3a83f commit 2cce4ea

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

vignettes/sampleSize_parallel_2A1E.Rmd

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ doc.cache <- T #for cran; change to F
2626

2727

2828
## Difference of Means Test
29-
This example, adapted from Example 1 in the PASS manual chapter titled *"Biosimilarity Tests for the Difference Between Means Using a Parallel Two-Group Design"*, illustrates the process of planning a clinical trial to assess biosimilarity. Specifically, the trial aims to compare blood pressure outcomes between two groups.
29+
This example, adapted from Example 1 in the PASS manual chapter titled [*"Biosimilarity Tests for the Difference Between Means Using a Parallel Two-Group Design"*](https://www.ncss.com/wp-content/themes/ncss/pdf/Procedures/PASS/Biosimilarity_Tests_for_the_Difference_Between_Means_using_a_Parallel_Two-Group_Design.pdf), illustrates the process of planning a clinical trial to assess biosimilarity. Specifically, the trial aims to compare blood pressure outcomes between two groups.
3030

3131
### Scenario
3232
Drug B is a well-established biologic drug used to control blood pressure. Its exclusive marketing license has expired, creating an opportunity for other companies to develop biosimilars. Drug A is a new competing drug being developed as a potential biosimilar to Drug B. The goal is to determine whether Drug A meets FDA biosimilarity requirements in terms of safety, purity, and therapeutic response when compared to Drug B.
@@ -36,9 +36,8 @@ The study follows a parallel-group design with the following key assumptions:
3636

3737
* Reference Group (Drug B): The average blood pressure is 96 mmHg, with a within-group standard deviation of 18 mmHg.
3838
* Mean Difference: As per FDA guidelines, the assumed difference between the two groups is set to $\delta = \sigma/8 = 2.25$ mmHg.
39-
* Biosimilarity Limits: These are defined as ±1.5σ = ±27 mmHg, ensuring compliance with regulatory requirements.
40-
* Type-I Error Rate: A one-sided α=0.025 is specified.
41-
* Desired Power: The target power for the study is 90%
39+
* Biosimilarity Limits: These are defined as ±1.5σ = ±27 mmHg.
40+
* Type-I Error Rate: A one-sided α = 0.025 is specified.
4241

4342
To implement these parameters in R, the following code snippet can be used:
4443

@@ -58,16 +57,33 @@ lequi_upper <- setNames(27, "BP")
5857
```
5958

6059
### Objective
61-
To explore the power of the test across a range of group sample sizes, the researchers plan to calculate the power for group sizes varying from 6 to 20. These calculations will use the noncentral t-distribution to evaluate the ability of the study design to detect the specified difference and meet biosimilarity criteria.
60+
To explore the power of the test across a range of group sample sizes, the researchers plan to calculate the power for group sizes varying from 6 to 20.
6261

62+
### Implementation
63+
To estimate the power for different sample sizes, we use the [sampleSize()](../reference/sampleSize.html) function. The function is configured with a power target of 0.90, a type-I error rate of 0.025, and the specified mean and standard deviation values for the reference and treatment groups. The optimization method is set to `"step-by-step"` to display the achieved power for each sample size, providing detailed insights into the results.
64+
65+
Below is an example of how the function can be implemented in R:
6366

6467
```r
65-
sampleSize(power = 0.86, alpha = 0.025,
66-
mu_list = list("R" = mu_r, "T" = mu_t),
67-
sigma_list = list("R" = sigma, "T" = sigma),
68-
list_comparator = list("T_vs_R" = c("R", "T")),
69-
list_lequi.tol = list("T_vs_R" = lequi_lower),
70-
list_uequi.tol = list("T_vs_R" = lequi_upper),
71-
dtype = "parallel", ctype = "DOM", lognorm = FALSE,
72-
adjust = "no", ncores = 1, nsim = 1000, seed = 1234)
68+
(N_ss <- sampleSize(
69+
power = 0.90, # Target power
70+
alpha = 0.025, # Type-I error rate
71+
mu_list = list("R" = mu_r, "T" = mu_t), # Means for reference and treatment groups
72+
sigma_list = list("R" = sigma, "T" = sigma), # Standard deviations
73+
list_comparator = list("T_vs_R" = c("R", "T")), # Comparator setup
74+
list_lequi.tol = list("T_vs_R" = lequi_lower), # Lower equivalence limit
75+
list_uequi.tol = list("T_vs_R" = lequi_upper), # Upper equivalence limit
76+
dtype = "parallel", # Study design
77+
ctype = "DOM", # Comparison type
78+
lognorm = FALSE, # Assumes normal distribution
79+
optimization_method = "step-by-step", # Optimization method
80+
adjust = "no", # No adjustments
81+
ncores = 1, # Single-core processing
82+
nsim = 1000, # Number of simulations
83+
seed = 1234 # Random seed for reproducibility
84+
))
85+
86+
# Display iteration results
87+
N_ss$table.iter
7388
```
89+

0 commit comments

Comments
 (0)