Package index
-
sample_aggregate_binary_data() - Sample aggregate binary data based on the rate and sample size
-
sample_aggregate_normal_data() - Sample aggregate normal data based on the mean and variance
-
sample_log_odds_ratios() - Sample log odds ratios based on the number of participants and responders in each arm
-
compute_ORs() - Compute odds ratios based on the number of participants and responders in each arm
-
compute_log_odds_ratio_from_counts() - Compute the log odds ratio from count data
-
rate_from_drift_logOR() - Calculate the success rate in the target study arm from the drift on the log odds ratio scale
-
rate_from_drift_logRR() - Calculate the rate in the target study arm from the drift on the log relative risk scale
-
standard_error_log_odds_ratio() - Compute the standard error of the log odds ratio
-
BinomialPooling - BinomialPooling class
-
BinomialSeparate - BinomialSeparate class
-
GaussianConjugate - GaussianConjugate class
-
GaussianPDCCPP - GaussianPDCCPP class
-
GaussianPooling - GaussianPooling class
-
RecurrentEventTargetData - Recurrent Event Target Data
-
GaussianSeparate - GaussianSeparate class
-
GaussianStaticBorrowing - GaussianStaticBorrowing class
-
TestThenPool - TestThenPool class
-
TestThenPoolDifference - TestThenPoolDifference class
-
TestThenPoolEquivalence - TestThenPoolEquivalence class
-
GaussianEmpiricalBayesPP - GaussianEmpiricalBayesPP class
-
GaussianGravestockEBPP - GaussianGravestockEBPP class
-
GaussianNPP - GaussianNPP class
-
GaussianNPP_KL - GaussianNPP_KL class
-
BinomialCPP - BinomialCPP Class
-
BinomialNPP - BinomialNPP class
-
BinomialGravestockEBPP - BinomialGravestockEBPP class
-
BinomialLatticePrior - BinomialLatticePrior class
-
BinomialNPP_KL - BinomialNPP_KL class
-
BinomialPDCCPP - BinomialPDCCPP class
-
BinomialRMP - BinomialRMP class
-
BinomialEgidiMixture - BinomialEgidiMixture class
-
BinomialCommensuratePowerPrior - BinomialCommensuratePowerPrior class
-
BinomialCommensuratePrior - BinomialCommensuratePrior class
-
GaussianCommensuratePowerPrior - GaussianCommensuratePowerPrior class
-
GaussianCommensuratePrior - GaussianCommensuratePrior class
-
GaussianEgidiMixture - GaussianEgidiMixture class
-
GaussianRMP_RBesT - GaussianRMP_RBesT class
-
Model_RBesT - Model_RBesT
-
GaussianPooling_RBesT - GaussianPooling_RBesT
-
GaussianSeparate_RBesT - GaussianSeparate_RBesT
-
MCMCModel - MCMCModel class
-
Model - Model Class
-
BinomialPValueBasedPP - GaussianEmpiricalBayesPP class
-
GaussianPValueBasedPP - GaussianPValueBasedPP class
-
BinomialConjugate - BinomialConjugate class
Binomial quadrature
Exact posteriors of a difference in response rates for the binomial borrowing models, computed on a grid instead of sampled
-
binomial_power_prior_posterior() - Posterior of the treatment effect under the binomial power prior
-
binomial_effect_grid() - Grid of treatment effects covering a binomial posterior
-
beta_quadrature_nodes() - Quantile midpoints of a Beta distribution
-
beta_sd() - Standard deviation of a Beta distribution
-
grid_posterior() - Summarise a density tabulated on a grid
-
grid_posterior_cdf() - Distribution function of a grid posterior
-
grid_posterior_pdf() - Density of a grid posterior
-
grid_posterior_quantile() - Quantiles of a grid posterior
-
grid_posterior_sample() - Draw from a grid posterior
Vectorised inference
Conjugate updates and frequentist tests evaluated across all replicates of a scenario at once
-
normal_mixture_posterior() - Conjugate update of a normal mixture prior across replicates
-
analyse_in_replicate_chunks() - Run a vectorised analysis of the replicates in chunks
-
combine_replicate_results() - Concatenate the results of consecutive chunks of replicates
-
fit_egidi_mixture() - Fit the Egidi, Pauli and Torelli empirical mixture prior
-
normal_mixture_summary() - Mean, standard deviation and quantiles of a normal mixture, per replicate
-
normal_mixture_elir_ess() - ELIR effective sample size of a normal mixture, per replicate
-
npp_prior_mixture() - Discretise the normalised power prior as a normal mixture
-
calibrate_npp_kl() - Calibrate the normalised power prior by a KL criterion
-
summary_t_test_p_value() - Two-sample t-test from summary statistics, across replicates
-
method_style() - Fixed shape and hue for a method
-
method_key() - Resolve a method to its configuration key
-
method_shape_map() - Shapes for a set of methods, keyed by method
-
method_hue_map() - Base hues for a set of methods, keyed by method
-
method_hue_ramp() - A light-to-dark ramp through a method's hue
-
method_parameter_colors() - Colours for the parameter values of one method
-
method_parameter_color_map() - Colours for the parameter values present in one method's rows
-
method_parameter_positions() - Where each parameter label sits on its method's ramp
-
style_config_object() - Resolve a configuration object the plot code keeps in the global environment
-
style_blend() - Blend a colour towards another
-
style_label_numbers() - Numbers a parameter label assigns to its parameters
-
style_numeric_ranges() - The numeric parameter ranges a method's configuration declares
-
style_tuple_key() - A tuple of parameter values as a lookup key
-
plot_metric_vs_scenario() - Plot methods operating characteristics
-
forest_plot() - Generate a forest plot
-
estimate_bayesian_ocs() - Simulation Bayesian OCs
-
set_size() - Function to set figure dimensions
-
nominal_tie_breaks() - Axis breaks that always show the nominal type-I error
-
has_monte_carlo_uncertainty() - Whether a pair of bound columns carries Monte Carlo uncertainty
-
plot_baseline_success_proba_vs_xvar() - Add a reference probability of success to a metric-vs-x-variable plot
-
bayesian_metric_vs_parameters() - Function to plot metric vs parameters
-
bayesian_metric_vs_sample_size() - Function to plot metric vs sample size
-
bayesian_ocs_plots() - Plot methods operating characteristics
-
frequentist_power_at_equivalent_tie() - Compute the frequentist power at equivalent tie
-
frequentist_power_at_nominal_tie() - Compute the frequentist power at the nominal type I error rate
-
plot_metric_vs_drift() - Function to generate a metric vs drift plot
-
plot_metric_vs_parameters() - Function to plot metric vs parameters
-
plot_metric_vs_sample_size() - Function to plot metric vs sample size
-
power_vs_tie() - Function to generate a power vs tie plot
-
posterior_parameters_plots() - Plot frequentist methods operating characteristics
-
power_vs_tie_plots() - Plot frequentist methods operating characteristics
-
forest_plot_methods_comparison() - Plot methods comparison
-
forest_plot_bayesian() - Generate a forest plot for bayesian metrics
-
forest_plot_methods_comparison_bayesian() - Plot methods comparison
-
plot_metrics_vs_ess() - Plot methods operating characteristics
-
plot_posterior_parameters_vs_drift() - Function to plot posterior parameters vs drift
-
plot_success_proba_vs_drift() - Function to generate a metric vs drift plot
-
plot_success_proba_vs_scenario() - Plot methods operating characteristics
-
plot_empirical_bayes_hyperparameters_vs_drift() - Plot Empirical Bayes Hyperparameters vs Drift
-
empirical_bayes_parameters_plots() - Plot the posterior parameters
-
bayesian_operating_characteristics_vs_tie_plots() - Plot methods operating characteristics
-
forest_plot_sweet_spot() - Generate a forest plot
-
forest_plot_sweet_spots_comparison() - Plot methods comparison
-
operating_characteristics_vs_tie_plots() - Plot methods' operating characteristics
-
operating_characteristic_vs_tie() - Plot an operating characteristic against the type I error rate
-
plot_metric_vs_drift_methods() - Function to generate a metric vs drift plot
-
plot_sweet_spot_width_vs_scenario() - Plot methods operating characteristics
-
plot_metric_vs_sample_size_methods() - Function to plot metric vs sample size
-
plot_metric_vs_scenario_methods() - Plot methods operating characteristics
-
scale_by_separate() - Express a metric as a ratio to the separate analysis
-
average_power() - Calculate the average power
-
average_tie() - Calculate the average type 1 error
-
sweet_spot() - Calculate Sweet Spots for Multiple Metrics
-
sweet_spot_determination() - Determine Sweet Spot Bounds and Width
-
upper_bound_proba_FP_MC() - Calculate the upper bound probability of false positive
-
compute_freq_power() - Compute the frequentist power
-
preposterior_proba_FP_MC() - Calculate the probability of false positive
-
preposterior_proba_TP_MC() - Calculate the probability of true positive
-
prior_moment_ess() - Calculate the prior moment-based Effective Sample Size (ESS) for a Bayesian model.
-
prior_precision_ess() - Calculate the prior precision-based Effective Sample Size (ESS) for a Bayesian model.
-
gaussian_mix_moment_ess() - Calculate the moment-based Effective Sample Size (ESS) for a Gaussian mixture.
-
gaussian_mix_precision_ess() - Calculate the precision-based Effective Sample Size (ESS) for a Gaussian mixture.
-
compute_freq_power_pooling() - Compute the frequentist power
-
prior_ess_elir() - Calculate the priorEffective Sample Size (ESS) based on ELIR for a Bayesian model.
-
normal_reference_ess() - Effective sample sizes of a posterior summarised against a normal reference
-
adaptive_power_prior_type_I_error() - Type I error of the adaptive power prior, computed exactly
-
log_grid_interpolation() - Interpolate an expensive function of a positive scalar
-
interval_score() - Interval score of a credible interval
-
compute_power_with_tie_ci() - Compute the frequentist power at an estimated type I error
Monte Carlo uncertainty
Propagating simulation error into the comparison with the frequentist benchmark at equivalent type I error
-
binomial_replicate_count() - Recover the number of Monte Carlo replicates behind a binomial estimate
-
sample_binomial_proportion() - Draw from the posterior of a binomial proportion
-
mover_difference_ci() - Confidence interval for a difference, by variance estimate recovery
-
add_power_difference_columns() - Replace success probabilities by power differences
-
flag_power_differences() - Flag power gains and power losses against the comparator
-
compute_control_drift_range() - Compute the control drift range for a given source treatment effect.
-
compute_drift_range() - Compute the drift range for a given simulation and case study configuration.
-
compute_source_denominator_range() - Compute the source denominator range for a given source data, simulation configuration, and case study configuration.
-
compute_time_to_event_ranges() - Compute the ranges of the time-to-event design axes.
-
frequentist_ocs_scenario_simulation() - Simulate a Scenario
-
bayesian_ocs_scenario_simulation() - Simulate a Scenario
-
simulation_analysis() - Perform Simulation Analysis
-
simulation_bayesian_ocs() - Run simulations based on the given environment
-
simulation_frequentist_ocs() - Run simulations based on the given environment
-
simulation_scenarios() - Generate simulation scenarios based on the configuration directory.
-
run_simulation_env() - Run a full simulation for one environment
-
run_progress_tracker() - Track how many scenarios of a run have been simulated.
-
time_to_event_expected_events() - Expected number of observed events in each arm of the target trial
-
time_to_event_delayed_log_hr() - Post-delay log hazard ratio that gives a target Cox estimand
-
is_primary_time_to_event_design() - The design a time-to-event case study is primarily simulated under
-
time_to_event_axes_off_primary() - How many time-to-event design axes are off their primary value
-
time_to_event_sensitivity_reference() - The point at which the time-to-event sensitivity designs are simulated
-
table_methods_comparison() - Methods comparison in a table
-
posterior_parameters_tables() - Generate multiple posterior parameter tables
-
power_vs_tie_tables() - Generate power vs tie tables for multiple conditions
-
table_power_vs_tie() - Generate a power vs tie table
-
table_bayesian_ocs() - Generate tables for methods operating characteristics
-
table_metric_vs_drift() - Generate a metric vs drift table
-
table_metric_vs_parameters() - Plot metric vs parameters
-
table_metric_vs_sample_size() - Plot metric vs sample size
-
table_posterior_parameters_vs_drift() - Generate a table of posterior parameters vs drift
-
tables_metric_vs_scenario() - Generate tables for methods operating characteristics
-
table_empirical_bayes_hyperparameters_vs_drift() - Generate a table of hyperparameters estimated using Empirical Bayes vs drift
-
table_empirical_bayes_hyperparameters_vs_scenario() - This function tables for hyperparameters updated using Empirical Bayes across different case studies, methods, and sample sizes.
-
table_bayesian_metrics() - Generate tables for Bayesian metrics
-
table_case_study_summary() - Summary of the clinical case studies (table S3)
-
table_drift_ranges_and_sample_sizes() - Drift ranges and target sample sizes for each case study (table S1)
Paper replication
The manifest of the paper’s figures and tables, and what a results directory needs to reproduce them
-
paper_manifest() - The paper figure and table manifest
-
paper_manifest_ids() - Ids of every paper item in the manifest
-
paper_manifest_entry() - Look up one manifest entry by id
-
paper_sample_size_per_arm() - Resolve a sample size factor to a target sample size per arm
-
paper_replication_requirements() - Minimal simulation config for a set of paper figures
-
paper_replication_coverage() - Check a results frame against a set of paper figures
-
paper_run_config() - The simulation config a results directory was produced from
-
paper_config_shortfalls() - How a results directory falls short of the paper's fidelity
-
export_paper_outputs() - Produce the paper's figures and tables
-
TargetData - TargetData class
-
TargetDataFactory - TargetDataFactory class
-
SourceData - SourceData class
-
BinaryTargetData - BinaryTargetData class
-
ObservedSourceData - ObservedSourceData class
-
ObservedTargetData - ObservedTargetData class
-
ContinuousTargetData - ContinuousTargetData class
-
TimeToEventTargetData - Time To Event Target Data
-
DesignPrior - DesignPrior Class
-
AnalysisPriorDesignPrior - AnalysisPriorDesignPrior class
-
SourcePosteriorDesignPrior - SourcePosteriorDesignPrior class
-
UnitInformationDesignPrior - UnitInformationDesignPrior class
-
inference_cache_size() - Number of analyses held in the cache
-
inference_cache_reset() - Empty the analysis cache
-
generate_replicates() - Generate the replicates of a scenario, reusing them across methods
-
generation_cache_key() - Key of a set of generated replicates
-
npp_kl_calibration_cache_size() - Number of calibrations held in the cache
-
npp_kl_calibration_cache_reset() - Empty the KL calibration cache
-
clear_stan_draws() - Remove the Stan draws of one model across every process
-
clear_stan_model_cache() - Remove the compiled Stan models
-
check_colnames() - Check columns in a dataframe
-
combine_parameters() - Combine parameters for a given method.
-
append_parameters_str() - Append a parameter string to a figure or table filename
-
convert_params_to_str() - Function to convert parameters in dataframe to string
-
hellinger_distance() - Compute the Hellinger distance between two normal distributions.
-
important_drift_values() - Get important drift values for a given source treatment effect and case study configuration.
-
make_labels_from_parameters() - Function to make labels from parameters. Return a label formatted in Tex, for example "$\xi_\gamma$ = 0.5, $\sigma_\gamma$ = 0.1"
-
negative_binomial_regression() - Estimate rate and standard error
-
findCalibrationParameter() - Find Calibration Parameter
-
get_parameters() - Function to return a dataframe of parameters from json strings
-
remove_columns_from_df() - Remove columns from a dataframe
-
generate_comparison_table() - Generate a comparison table
-
read_function_code() - Print a function's source code
-
format_simulation_output_table() - Format simulation output as a printable table
-
format_case_study_config() - Format a case study configuration as a printable table