sim <- load_example_data()
print(sim)
#>
#> ── dynasimR_data ───────────────────────────────────────────────────────────────
#> • Scenarios: 4
#> • Profile: "Profile_A"
#> • Summary rows: 200
#> • Entity events: 16000
#> • Loaded: "2026-11-03 18:08"
#> • Path: '/tmp/RtmpCBw96w/Rinst188a71273f10/dynasimR/extdata'km <- km_estimate(sim, endpoint = "stage2",
stratify_by = "scenario")
plot_km(km, title = "Time-to-stage-2")pol <- policy_effect(sim,
policy_a_scenario = "A-S08",
policy_b_scenario = "A-S07",
n_bootstrap = 200)
cat(pol$narrative)
#> The policy A-minus-B event-rate difference (scenario A-S08 vs. A-S07) was -7.4 percentage points (95% CI: -9.1 to -5.6); the event rate was lower under policy A (Wilcoxon test: W = 215, adjusted p < 0.001). The Compliance Index was higher under policy A (0.919 vs. 0.658).Only two AL points are present in the shipped example data, but the machinery is the same for a full AL sweep.
al <- al_efficiency(
sim,
al_scenarios = c("0" = "A-S00", "1" = "A-S01"),
compliance_threshold = 0.80,
n_bootstrap = 200
)
plot_al_tradeoff(al)