CaCu survival: an estimand that shows the probability of surviving

The model gives the probability of dying (`muerte`, like every batch the probability of its outcome); `complement =
"supervivencia"` tells the screens to show its complement as the probability of surviving, from the first invasive
biopsy, with its covariates.
This commit is contained in:
2026-11-22 15:04:03 -06:00
parent f00dd31450
commit 34b26d8c85
2 changed files with 20 additions and 0 deletions
+9
View File
@@ -281,3 +281,12 @@ def test_the_subgroup_notebook_runs_on_a_builds_file(cohort_file, monkeypatch):
found = _run_notebook(path, cohort_file, "cacu", "survival", monkeypatch)
assert sum(r["n"] for r in found["survival"]) == N
def test_the_survival_scenario_shows_the_probability_of_surviving():
"""Pins down: the scenario's estimand names the probability of surviving and marks it as the complement of the
model's number (the probability of dying), so the patient's record shows survival, with its covariates. Fails if
`complement` is dropped: the record would show a death probability labelled as survival."""
estimand = Scenario.load("cacu", "survival").estimand
assert estimand["quantity"] == "Probabilidad de supervivencia" and estimand["complement"] == "supervivencia"
assert estimand["index_date"] == "la primera biopsia con carcinoma invasor" and "VPH" in estimand["covariates"]