| Title: | Sample Size Calculation for External Pilot Studies for a Continuous Endpoint |
|---|---|
| Description: | An implementation of sample size calculations for external pilot studies that minimize the overall trial sample size for the external pilot and main trial for a continuous endpoint as described in Whitehead et al. (2016) <doi:10.1177/0962280215588241>. |
| Authors: | Joel Dadiboe [aut, cre, cph], Marcio Diniz [aut, rev, cph] |
| Maintainer: | Joel Dadiboe <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0.0 |
| Built: | 2026-09-29 16:35:28 UTC |
| Source: | https://github.com/cran/ssPilot |
Calculates the required main-trial sample size per treatment arm using the non-central t-distribution (NCT) approach described by Julious and Owen.
nct_sample_size( pilot_n, sd, effect, power = 0.9, alpha = 0.05, allocation = 1, max_n = 10000 )nct_sample_size( pilot_n, sd, effect, power = 0.9, alpha = 0.05, allocation = 1, max_n = 10000 )
pilot_n |
Pilot trial sample size per treatment arm. |
sd |
Pilot estimate of the standard deviation. |
effect |
Expected treatment difference. |
power |
Desired statistical power. |
alpha |
Type I error rate. |
allocation |
Allocation ratio of experimental to control arm. |
max_n |
Maximum main-trial sample size per arm to search. |
See also ssPilot::optimized_nct_sample_size.
A list containing the pilot-trial sample size per arm, pilot-trial degrees of freedom, required main-trial sample size per arm, main-trial degrees of freedom, central t critical value, non-central t quantile, and the right-hand side of Equation (4).
Julious SA and Owen RJ. Sample size calculations for clinical studies allowing for uncertainty about the variance. Pharmaceut Stat 2006; 5: 29–37.
nct_sample_size( pilot_n = 12, sd = 1, effect = 0.50, power = 0.90, alpha = 0.05 )nct_sample_size( pilot_n = 12, sd = 1, effect = 0.50, power = 0.90, alpha = 0.05 )
Determines the pilot-trial sample size per treatment arm that minimizes the total sample size required for the pilot and main trials using the non-central t-distribution (NCT) approach.
optimized_nct_sample_size( sd, effect, power = 0.9, alpha = 0.05, allocation = 1, min_pilot_n = 10, max_pilot_n = 100, max_main_n = 10000 )optimized_nct_sample_size( sd, effect, power = 0.9, alpha = 0.05, allocation = 1, min_pilot_n = 10, max_pilot_n = 100, max_main_n = 10000 )
sd |
Anticipated standard deviation based on prior knowledge, previous studies, published literature, or other available evidence. |
effect |
Expected treatment difference. |
power |
Desired statistical power. |
alpha |
Type I error rate. |
allocation |
Allocation ratio of experimental to control arm. |
min_pilot_n |
Minimum pilot sample size per treatment arm. |
max_pilot_n |
Maximum pilot sample size per treatment arm. |
max_main_n |
Maximum main-trial sample size per treatment arm passed to [nct_sample_size()]. |
The function evaluates a range of possible pilot sample sizes and calls [nct_sample_size()] for each candidate pilot size. The optimal pilot sample size is the one that minimizes the combined pilot and main-trial sample size per arm.
A list containing:
Optimal pilot sample size per arm.
Required main-trial sample size per arm corresponding to the optimal pilot size.
Combined pilot and main-trial sample size per arm.
Degrees of freedom from the pilot trial.
Degrees of freedom from the main trial.
Critical value from the corresponding main-trial calculation.
Non-central t quantile from the corresponding calculation.
Sample-size equation value from the corresponding calculation.
Data frame containing the results for all candidate pilot sample sizes.
Whitehead, A. L., Julious, S. A., Cooper, C. L., & Campbell, M. J. (2016). Estimating the sample size for a pilot randomised trial to minimise the overall trial sample size for the external pilot and main trial for a continuous outcome variable. Statistical Methods in Medical Research, 25(3), 1057–1073.
results <- optimized_nct_sample_size( sd = 1, effect = 0.50, power = 0.90, alpha = 0.05 ) plot(results)results <- optimized_nct_sample_size( sd = 1, effect = 0.50, power = 0.90, alpha = 0.05 ) plot(results)
Finds the pilot-trial sample size per treatment arm that minimizes the combined pilot and main-trial sample size using the upper confidence limit approach.
optimized_ucl_sample_size( sd, effect, power = 0.9, alpha = 0.05, allocation = 1, conf_level = 0.8, min_pilot = 10, max_pilot = 100 )optimized_ucl_sample_size( sd, effect, power = 0.9, alpha = 0.05, allocation = 1, conf_level = 0.8, min_pilot = 10, max_pilot = 100 )
sd |
Anticipated standard deviation based on prior knowledge, previous studies, published literature, or other available evidence. |
effect |
Expected treatment difference. |
power |
Desired statistical power for the main trial. |
alpha |
Type I error rate. |
allocation |
Allocation ratio of experimental to control arm. |
conf_level |
Confidence level for the upper confidence limit. |
min_pilot |
Minimum pilot sample size per treatment arm. |
max_pilot |
Maximum pilot sample size per treatment arm to search. |
A list containing the optimal pilot sample size per arm, the corresponding main-trial sample size per arm, the total sample size per arm, the confidence level used, and a data frame containing the optimization results for all candidate pilot sample sizes.
Whitehead, A. L., Julious, S. A., Cooper, C. L., & Campbell, M. J. (2016). Estimating the sample size for a pilot randomised trial to minimise the overall trial sample size for the external pilot and main trial for a continuous outcome variable. Statistical Methods in Medical Research, 25(3), 1057–1073.
results <- optimized_ucl_sample_size( sd = 1, effect = 0.50, power = 0.90, alpha = 0.05, conf_level = 0.80 ) plot(results)results <- optimized_ucl_sample_size( sd = 1, effect = 0.50, power = 0.90, alpha = 0.05, conf_level = 0.80 ) plot(results)
Creates a plot showing the relationship between pilot-trial sample size and the corresponding main-trial sample size from an optimized sample size calculation. The combination that minimizes the total sample size is highlighted.
## S3 method for class 'sspilot' plot(x, ...)## S3 method for class 'sspilot' plot(x, ...)
x |
A data frame containing the optimization results. It must contain columns named 'pilot_n_per_arm', 'main_n_per_arm', and 'total_n_per_arm'. |
... |
Additional arguments to be passed to methods. |
A ggplot object showing pilot-trial sample size against main-trial sample size, with the optimal combination highlighted.
ucl_results <- optimized_ucl_sample_size( sd = 1, effect = 0.50, power = 0.90, alpha = 0.05 ) plot(ucl_results)ucl_results <- optimized_ucl_sample_size( sd = 1, effect = 0.50, power = 0.90, alpha = 0.05 ) plot(ucl_results)
Calculates the required main-trial sample size per treatment arm assuming the population standard deviation is known.
standard_sample_size(sd, effect, power = 0.9, alpha = 0.05, allocation = 1)standard_sample_size(sd, effect, power = 0.9, alpha = 0.05, allocation = 1)
sd |
Population standard deviation. |
effect |
Expected treatment difference. |
power |
Desired statistical power. |
alpha |
Type I error rate. |
allocation |
Allocation ratio of experimental to control arm. |
Required sample size per treatment arm.
standard_sample_size( sd = 1, effect = 0.5, power = 0.90, alpha = 0.05 )standard_sample_size( sd = 1, effect = 0.5, power = 0.90, alpha = 0.05 )
Calculates the required main-trial sample size per treatment arm using the upper confidence limit (UCL) approach described by Browne.
ucl_sample_size( pilot_n, sd, effect, power = 0.9, alpha = 0.05, allocation = 1, conf_level = 0.8 )ucl_sample_size( pilot_n, sd, effect, power = 0.9, alpha = 0.05, allocation = 1, conf_level = 0.8 )
pilot_n |
Pilot trial sample size per treatment arm. |
sd |
Pilot estimate of the standard deviation. |
effect |
Expected treatment difference. |
power |
Desired statistical power. |
alpha |
Type I error rate. |
allocation |
Allocation ratio of experimental to control arm. |
conf_level |
Confidence level for the upper confidence limit. |
Browne recommends an 80 level. However, Sim and Lewis, set X at 0.95 or the 95
A list containing the degrees of freedom, upper confidence limit for the variance, upper confidence limit for the standard deviation, and main-trial sample size per treatment arm.
Browne RH. On the use of a pilot sample for sample size determination. Stat Med 1995; 14: 1933–1940.
Sim J and Lewis M. The size of a pilot study for a clinical should be calculated in relation to considerations of precision and efficiency. J Clin Epidemiol 2012; 65: 301–308.
ucl_sample_size( pilot_n = 16, sd = 1, effect = 0.50, power = 0.90, alpha = 0.05, conf_level = 0.80 )ucl_sample_size( pilot_n = 16, sd = 1, effect = 0.50, power = 0.90, alpha = 0.05, conf_level = 0.80 )