# Synthetic diagnostics with the manuscript's reported counts and leader names. # These are deterministic test data, not a reproduction of manuscript results. calibration_freeze_fixture <- function() { diagnostic <- data.frame( scenario_id = paste0("synthetic_", seq_len(100)), tau = 3, min_mean_p_risk = c(rep(0.15, 80), rep(0.4, 12), rep(0.15, 8)), min_mean_n_risk = c(rep(12, 80), rep(25, 12), rep(5, 8)), p_support = 0.99, p_support_lower = 0.97, p_support_upper = 1, type1_one_lower = c(rep(0.02, 92), 0.07, rep(0.04, 7)), type1_one_upper = c(rep(0.05, 92), 0.09, rep(0.08, 7)), coverage_lower = 0.95, coverage_upper = 0.99, n_sim = 1000, n_support_valid = 990, design_note = "synthetic calibration setting" ) rules <- data.frame( rule_id = c("A_p005", "B_p005_n10", "B_p010_n10", paste0("B_strict_", seq_len(17))), family = c("A", rep("B", 19)), p_risk_threshold = c(0.05, 0.05, 0.10, seq(0.21, 0.37, by = 0.01)), p_support_threshold = 0.95, use_absolute_n = c(FALSE, rep(TRUE, 19)), n_risk_threshold = c(NA, rep(10, 19)) ) list( diagnostic = diagnostic, rules = rules, rule_id = "B_p010_n10", rationale = "Choose the equivalent 10% threshold for interpretability.", calibration_scope = list( design = "Synthetic two-arm survival trial", horizon_grid = 3, settings = diagnostic[c("scenario_id", "tau")] ), provenance = list( source = "Deterministic synthetic test fixture", inference_conditioning = "support_valid", code_version = "fixture-v1" ), simulation_settings = list( n_sim = 1000, seed = 42, alpha = 0.05, conf_level = 0.95 ) ) } freeze_calibration_fixture <- function(fixture = calibration_freeze_fixture(), ...) { changes <- list(...) fixture[names(changes)] <- changes do.call(freeze_support_rule, fixture) } # Saved support-audit column names, with the same deterministic synthetic data. calibration_audit_fixture <- function() { fixture <- calibration_freeze_fixture() candidate_rule_grid <- fixture$rules scenario_summary <- fixture$diagnostic names(candidate_rule_grid)[names(candidate_rule_grid) == "family"] <- "rule_family" names(scenario_summary)[names(scenario_summary) == "n_sim"] <- "total_sim_n" list(candidate_rule_grid = candidate_rule_grid, scenario_summary = scenario_summary) }