as_outcomes
run.as_outcomes(
source,
*,
intervention='intervention',
iteration='iteration',
cost='cost',
effect='qaly',
comparator=None,
)Normalise any costs/effects table into the standard outcome structure.
This is the bring-your-own-outputs entry point: feed a tidy table from any source directly into the analysis layer.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| source | Outcomes | pd.DataFrame | str | Path |
An Outcomes (returned unchanged), a tidy long DataFrame, or a path to a CSV file of one. |
required |
| intervention | str |
Column holding the intervention label. | 'intervention' |
| iteration | str |
Column holding the iteration index. | 'iteration' |
| cost | str |
Column holding the cost per iteration. | 'cost' |
| effect | str |
Column holding the effect (QALYs by default). | 'qaly' |
| comparator | str | None |
Name of the reference intervention, or None. Ignored when source is already an Outcomes. |
None |
Example
import pandas as pd from heormodel.run import as_outcomes df = pd.DataFrame({“intervention”: [“A”, “B”], “iteration”: [0, 0], … “cost”: [1.0, 2.0], “qaly”: [0.5, 0.7]}) as_outcomes(df).interventions [‘A’, ‘B’]