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
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.
61
+
To explore the power of the test across a range of group sample sizes, power for group sizes varying from 6 to 20 will be calculated.
62
62
63
63
### Implementation
64
-
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
+
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 insights into the results.
65
65
66
-
Below is an example of how the function can be implemented in R:
66
+
Below illustrates how the function can be implemented in R:
67
67
68
68
```{r}
69
69
library(SimTOST)
@@ -89,13 +89,13 @@ library(SimTOST)
89
89
N_ss$table.iter
90
90
```
91
91
92
-
We can visualize the power curve for different sample sizes using the following code snippet:
92
+
We can visualize the power curve for a range of sample sizes using the following code snippet:
93
93
94
94
```{r}
95
95
plot(N_ss)
96
96
```
97
97
98
-
To account for an anticipated dropout rate of 20% in each group, we need to adjust the sample size. The following code demonstrates how to incorporate this adjustment using a custom optimization routine. This routine is designed to find the smallest integer sample size that meets or exceeds the target power. It employs a stepwise search strategy, starting with larger step sizes and progressively refining them as it approaches the solution.
98
+
To account for an anticipated dropout rate of 20% in each group, we need to adjust the sample size. The following code demonstrates how to incorporate this adjustment using a custom optimization routine. This routine is designed to find the smallest integer sample size that meets or exceeds the target power. It employs a stepwise search strategy, starting with large step sizes that are progressively refined as the solution is approached.
99
99
100
100
```{r}
101
101
# Adjusted sample size calculation with 20% dropout rate
@@ -118,6 +118,6 @@ To account for an anticipated dropout rate of 20% in each group, we need to adju
118
118
))
119
119
```
120
120
121
-
Previously, finding the required sample size took `r nrow(N_ss$table.iter)` iterations. With the fast optimizer, the number of iterations is reduced to `r nrow(N_ss_dropout$table.iter)`, significantly improving efficiency.
121
+
Previously, finding the required sample size took `r nrow(N_ss$table.iter)` iterations. With the custom optimization routine, the number of iterations was reduced to `r nrow(N_ss_dropout$table.iter)`, significantly improving efficiency.
0 commit comments