Calculate and optionally plot power curves for different effect sizes and trial counts. This function takes a
calculate_power_curves(
trials,
effectsize = 1,
candidateset = NULL,
model = NULL,
alpha = 0.05,
gen_args = list(),
eval_function = "eval_design",
eval_args = list(),
random_seed = 123,
iterate_seed = FALSE,
plot_results = TRUE,
auto_scale = TRUE,
x_breaks = NULL,
y_breaks = seq(0, 1, by = 0.1),
ggplot_elements = list()
)
A data.frame of power values with design generation information.
A numeric vector indicating the trial(s) used when computing the power curve. If a single value, this will be fixed and only `effectsize` will be varied.
Default `1`. A numeric vector indicating the effect size(s) used when computing the power curve. If a single value, this will be fixed and only `trials` will be varied. If using a length-2 effect size with `eval_design_mc()` (such as a binomial probability interval), the effect size pairs can be input as entries in a list.
Default `NULL`. The candidate set (see `gen_design()` documentation for more information). Provided to aid code completion: can also be provided in `gen_args`.
Default `NULL`. The model (see `gen_design()` and `eval_design()` documentation for more information). Provided to aid code completion: can also be provided in `gen_args`/`eval_args`.
Default `0.05`. The allowable Type-I error rate (see `eval_design()` documentation for more information). Provided to aid code completion: can also be provided in `eval_args`.
Default `list()`. A list of argument/value pairs to specify the design generation parameters for `gen_design()`.
Default `"eval_design"`. A string (or function) specifying the skpr power evaluation function. Can also be `"eval_design_mc"`, `"eval_design_survival_mc"`, and `"eval_design_custom_mc"`.
Default `list()`. A list of argument/value pairs to specify the design power evaluation parameters for `eval_function`.
Default `123`. The random seed used to generate and then evaluate the design. The seed is set right before design generation.
Default `FALSE`. This will iterate the random seed with each new design. Set this to `TRUE` to add more variability to the design generation process.
Default `TRUE`. Whether to print out a plot of the power curves in addition to the data frame of results. Requires `ggplot2`.
Default `TRUE`. Whether to automatically scale the y-axis to 0 and 1.
Default `NULL`, automaticly generated by ggplot2.
Default `seq(0,1,by=0.1)`. Y-axis breaks.
Default `list()`. Extra `ggplot2` elements to customize the plot, passed in as elements in a list.