Skip to content

Commit ee58b8b

Browse files
Update sampleSize_parallel.Rmd
Edited for style and fixed errors.
1 parent 5def267 commit ee58b8b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

vignettes/sampleSize_parallel.Rmd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ options(rmarkdown.html_vignette.check_title = FALSE) #title of doc does not matc
2222
doc.cache <- T #for cran; change to F
2323
```
2424

25-
In the following examples, we demonstrate the use of **SimTOST** for parallel trial designs with data assumed to follow a normal distribution on the log scale. We start by loading the package.
25+
In the following two examples, we demonstrate the use of **SimTOST** for parallel trial designs with data assumed to follow a normal distribution on the log scale. We start by loading the package.
2626

2727
```{r, echo = T, message=F}
2828
library(SimTOST)
2929
```
3030

3131
# Multiple Independent Co-Primary Endpoints
32-
We here consider a bio-equivalence trial with 2 treatment arms and $m=5$ endpoints. The sample size is calculated to ensure that the test and reference products are equivalent with respect to all 5 endpoints. The true ratio between the test and reference products is assumed to be 1.05. It is assumed that the standard deviation of the log-transformed response variable is $\sigma = 0.3$, and that all tests are independent ($\rho = 0$). The equivalence limits are set at 0.80 and 1.25. The significance level is 0.05. The sample size is determined at a power of 0.8.
32+
Here, we consider a bio-equivalence trial with 2 treatment arms and $m=5$ endpoints. The sample size is calculated to ensure that the test and reference products are equivalent with respect to all 5 endpoints. The true ratio between the test and reference products is assumed to be 1.05. It is assumed that the standard deviation of the log-transformed response variable is $\sigma = 0.3$, and that all tests are independent ($\rho = 0$). The equivalence limits are set at 0.80 and 1.25. The significance level is 0.05. The sample size is determined at a power of 0.8.
3333

3434
This example is adapted from @mielke_sample_2018, who employed a difference-of-means test on the log scale. The sample size calculation can be conducted using two approaches, both of which are illustrated below.
3535

@@ -44,10 +44,10 @@ ssMielke <- sampleSize_Mielke(power = 0.8, Nmax = 1000, m = 5, k = 5, rho = 0,
4444
nsim = 10000)
4545
ssMielke
4646
```
47-
For 80\% power, `r ssMielke["SS"]` subjects per sequence (`r ssMielke["SS"] * 2` in total) would have been required.
47+
For 80\% power, `r ssMielke["SS"]` subjects per sequence (`r ssMielke["SS"] * 2` in total) would be required.
4848

4949
## Approach 2: Using sampleSize
50-
Alternatively, the sample size calculation can be performed using the [sampleSize()](../reference/sampleSize.html) function. This method assumes that effect sizes are normally distributed on the log scale and uses a difference-of-means test (`ctype = "DOM"`) with user-specified values for `mu_list` and `sigma_list`. Unlike the first approach, this method allows for greater flexibility in specifying parameter distributions.
50+
Alternatively, the sample size calculation can be performed using the [sampleSize()](../reference/sampleSize.html) function. This method assumes that effect sizes are normally distributed on the log scale and uses a difference-of-means test (`ctype = "DOM"`) with user-specified values for `mu_list` and `sigma_list`. This method allows for greater flexibility than Approach 1 in specifying parameter distributions.
5151

5252
```{r, eval = TRUE}
5353
mu_r <- setNames(rep(log(1.00), 5), paste0("y", 1:5))
@@ -68,11 +68,11 @@ ss
6868
```
6969
For 80\% power, a total of `r ss$response$n_total` subjects would be required.
7070

71-
As an alternative scenario, consider that the standard deviation of the log-transformed response variable is unknown, but the standard deviation on the original scale is known ($\sigma = 1$). In such cases, the [sampleSize()](../reference/sampleSize.html) function can still accommodate adjustments to handle these uncertainties by transforming parameters accordingly. We now provide all data on the raw scale, including equivalence bounds, and set `ctype = ROM` and `lognorm = TRUE`:
71+
Consider an alternative scenario in which the standard deviation of the log-transformed response variable is unknown, but the standard deviation on the original scale is known ($\sigma = 1$). In such cases, the [sampleSize()](../reference/sampleSize.html) function can still accommodate adjustments to handle these uncertainties by transforming parameters accordingly. We now provide all data on the raw scale, including the equivalence bounds, and set `ctype = ROM` and `lognorm = TRUE`.
7272

7373

7474
# Multiple Correlated Co-Primary Endpoints
75-
In the second example, we have $k=m=5$, $\sigma = 0.3$ and $\rho = 0.8$. This example is also adapted from @mielke_sample_2018, who employed a difference-of-means test on the log scale. The sample size calculation can again be conducted using two approaches, both of which are illustrated below.
75+
In the second example, we set $k=m=5$, $\sigma = 0.3$ and $\rho = 0.8$. This example is also adapted from @mielke_sample_2018, who employed a difference-of-means test on the log scale. The sample size calculation can again be conducted using two approaches, both of which are illustrated below.
7676

7777
## Approach 1: Using sampleSize_Mielke
7878
In the first approach, we calculate the required sample size for 80% power using the [sampleSize_Mielke()](../reference/sampleSize_Mielke.html) function. This method directly follows the approach described in @mielke_sample_2018, assuming a difference-of-means test on the log-transformed scale with specified parameters.
@@ -85,10 +85,10 @@ ssMielke <- sampleSize_Mielke(power = 0.8, Nmax = 1000, m = 5, k = 5, rho = 0.8,
8585
nsim = 10000)
8686
ssMielke
8787
```
88-
For 80\% power, `r ssMielke["SS"]` subjects per sequence (`r ssMielke["SS"] * 2` in total) would be been required.
88+
For 80\% power, `r ssMielke["SS"]` subjects per sequence (`r ssMielke["SS"] * 2` in total) would be required.
8989

9090
## Approach 2: Using sampleSize
91-
Alternatively, the sample size calculation can be performed using the [sampleSize()](../reference/sampleSize.html) function. This method assumes that effect sizes are normally distributed on the log scale and uses a difference-of-means test (`ctype = "DOM"`) with user-specified values for `mu_list`, `sigma_list`, and the correlation `rho`.
91+
Alternatively, the sample size calculation can be performed using the [sampleSize()](../reference/sampleSize.html) function. This method assumes that effect sizes are normally distributed on the log scale and uses a difference-of-means test (`ctype = "DOM"`) with user-specified values for `mu_list`, `sigma_list`, and the correlation parameter `rho`.
9292

9393
```{r}
9494
mu_r <- setNames(rep(log(1.00), 5), paste0("y", 1:5))

0 commit comments

Comments
 (0)