| summary | R Documentation |
Summarises simulation results from the run_trials() function. Uses
extract_results() and check_performance(), which may be used directly to
extract key trial results without summarising or to calculate performance
metrics (with uncertainty measures if desired) and return them in a tidy
data.frame.
## S3 method for class 'trial_results'
summary(
object,
select_strategy = "control if available",
select_last_arm = FALSE,
select_preferences = NULL,
te_comp = NULL,
raw_ests = FALSE,
final_ests = NULL,
restrict = NULL,
cores = NULL,
...
)
object |
|
select_strategy |
single character string. If a trial was not stopped
due to superiority (or had only 1 arm remaining, if
|
select_last_arm |
single logical, defaults to |
select_preferences |
character vector specifying a number of arms used
for selection if one of the |
te_comp |
character string, treatment-effect comparator. Can be either
|
raw_ests |
single logical. If |
final_ests |
single logical. If |
restrict |
single character string or |
cores |
|
... |
additional arguments, not used. |
A "trial_results_summary" object containing the following values:
n_rep: the number of simulations.
n_summarised: as described in check_performance().
highest_is_best: as specified in setup_trial().
elapsed_time: the total simulation time.
size_mean, size_sd, size_median, size_p25, size_p75,
size_p0, size_p100, sum_ys_mean, sum_ys_sd, sum_ys_median,
sum_ys_p25, sum_ys_p75, sum_ys_p0, sum_ys_p100, ratio_ys_mean,
ratio_ys_sd, ratio_ys_median, ratio_ys_p25, ratio_ys_p75,
ratio_ys_p0, ratio_ys_p100, prob_conclusive, prob_superior,
prob_equivalence, prob_futility, prob_max, prob_select_* (with
* being either "arm_<name> for all arm names or none), rmse,
rmse_te, mae, mae_te, and idp: performance metrics as described
in check_performance(). Note that all sum_ys_ and ratio_ys_
measures use outcome data from all randomised patients, regardless of
whether they had outcome data available at the last analysis or not, as
described in extract_results().
select_strategy, select_last_arm, select_preferences,
te_comp, raw_ests, final_ests, restrict: as specified above.
control: the control arm specified by setup_trial(),
setup_trial_binom() or setup_trial_norm(); NULL if no control.
equivalence_assessed, futility_assessed: single logicals,
specifies whether the trial design specification includes assessments of
equivalence and/or futility.
base_seed: as specified in run_trials().
cri_width, n_draws, robust, description, add_info: as
specified in setup_trial(), setup_trial_binom() or
setup_trial_norm().
extract_results(), check_performance(), plot_convergence(),
plot_metrics_ecdf(), check_remaining_arms().
# Setup a trial specification
binom_trial <- setup_trial_binom(arms = c("A", "B", "C", "D"),
control = "A",
true_ys = c(0.20, 0.18, 0.22, 0.24),
data_looks = 1:20 * 100)
# Run 10 simulations with a specified random base seed
res <- run_trials(binom_trial, n_rep = 10, base_seed = 12345)
# Summarise simulations - select the control arm if available in trials not
# ending with a superiority decision
res_sum <- summary(res, select_strategy = "control")
# Print summary
print(res_sum, digits = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.