Skip to contents

This function updates a previously saved "trial_results" object created and saved by run_trials() using a previous version of adaptr, allowing the results from these previous simulations to be post-processed (including performance metric calculation, printing and plotting) without errors by this version of the package. The function should be run only once per saved simulation object and will issue a warning if the object is already up to date. And overview of the changes made according to the adaptr package version used to generate the original object is provided in Details.
NOTE: some values cannot be updated and will be set to NA (the posterior estimates from the 'final' analysis conducted after the last adaptive analysis and including outcome data for all patients), and thus using both raw_ests = TRUE and final_ests = TRUE in the extract_results() and summary() functions will lead to missing values for some of the values calculated for updated simulation objects.
NOTE: other objects created by the adaptr package, i.e., trial specifications generated by setup_trial() / setup_trial_binom() / setup_trial_norm() and single simulation results from run_trials() when not included in as part of the returned output from run_trials() should be re-created by re-running the relevant code using the updated version of adaptr; if manually re-loaded from previous sessions, they may cause errors and problems with the updated version of the package.

Usage

update_saved_trials(path, version = NULL, compress = TRUE)

Arguments

path

single character; the path to the saved "trial_results"-object containing the simulations saved by run_trials().

version

passed to saveRDS() when saving the updated object, defaults to NULL (as in saveRDS()), which means that the current default version is used.

compress

passed to saveRDS() when saving the updated object, defaults to TRUE (as in saveRDS()), see saveRDS() for other options.

Value

Invisibly returns the updated "trial_results"-object.

Details

The following changes are made according to the version of adaptr used to generate the original "trial_results" object:

  • v1.2.0+: updates version number and the reallocate_probs argument in the embedded trial specification.

  • v1.1.1 or earlier: updates version number and everything related to follow-up and data collection lag (in these versions, the randomised_at_looks argument in the setup_trial() functions did not exist, but for practical purposes was identical to the number of patients with available data at each look) and the reallocate_probs argument in the embedded trial specification.

See also