diff --git a/models/cama/recurrence/site.py b/models/cama/recurrence/site.py index a648c60..eb61d52 100644 --- a/models/cama/recurrence/site.py +++ b/models/cama/recurrence/site.py @@ -99,8 +99,11 @@ def frame(events: pd.DataFrame, as_of) -> pd.DataFrame: def prepare(rows: pd.DataFrame) -> Cohort: """The site's cohort as a reference cohort is prepared: the nearly redundant covariates - dropped (cohorts.collinear).""" + dropped (cohorts.collinear) from the model, though kept in the table, since the clinical + scenarios name patients by them (the subtype, built from the receptors and Ki-67, is + redundant by construction).""" covariates = [c for c in rows.columns if c not in FIXED] dropped = collinear(rows, [c for c in covariates if c not in TREATMENT]) kept = [c for c in covariates if c not in dropped] - return Cohort("site", rows[FIXED + kept], kept, [c for c in TREATMENT if c in kept], dropped) + treatment = [c for c in TREATMENT if c in kept] + return Cohort("site", rows[FIXED + kept + dropped], kept, treatment, dropped)