ceac
cea.ceac
Acceptability curves, frontier, expected loss curves, and CE-plane data.
Functions
| Name | Description |
|---|---|
| ce_plane | Incremental cost and effect per iteration versus a comparator. |
| ceac | Cost-effectiveness acceptability curve for every intervention. |
| ceaf | Cost-effectiveness acceptability frontier. |
| expected_loss | Expected loss curve: mean foregone net benefit per intervention. |
ce_plane
cea.ceac.ce_plane(outcomes, *, comparator=None, effect=None)Incremental cost and effect per iteration versus a comparator.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| outcomes | Outcomes | Outcomes from a probabilistic sensitivity analysis. | required |
| comparator | str | None |
Reference intervention (default: the intervention flagged is_comparator=True at construction, via outcomes.comparator, or the first intervention if none was flagged). |
None |
| effect | str | None |
Effect column (default: the primary effect). | None |
Returns
| Name | Type | Description |
|---|---|---|
| pd.DataFrame | Tidy DataFrame with columns intervention, iteration, |
|
| pd.DataFrame | inc_cost and inc_effect for every non-comparator intervention, |
|
| pd.DataFrame | ready to scatter on the cost-effectiveness plane. |
Example
import pandas as pd from heormodel.models import Outcomes from heormodel.cea import ce_plane c = pd.DataFrame({“A”: [0.0], “B”: [10.0]}) e = pd.DataFrame({“A”: [0.0], “B”: [0.5]}) float(ce_plane(Outcomes.from_wide(c, e))[“inc_cost”][0]) 10.0
ceac
cea.ceac.ceac(outcomes, wtp, *, effect=None)Cost-effectiveness acceptability curve for every intervention.
For each willingness-to-pay value, the probability (share of iterations) that each intervention has the highest net monetary benefit.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| outcomes | Outcomes | Outcomes from a probabilistic sensitivity analysis. | required |
| wtp | ArrayLike | Sequence[float] |
Grid of willingness-to-pay values. | required |
| effect | str | None |
Effect column (default: the primary effect). | None |
Returns
| Name | Type | Description |
|---|---|---|
| pd.DataFrame | DataFrame indexed by wtp with one probability column per |
|
| pd.DataFrame | intervention; rows sum to 1. |
Example
import pandas as pd from heormodel.models import Outcomes from heormodel.cea import ceac c = pd.DataFrame({“A”: [0.0, 0.0], “B”: [10.0, 10.0]}) e = pd.DataFrame({“A”: [0.0, 0.0], “B”: [1.0, -1.0]}) float(ceac(Outcomes.from_wide(c, e), wtp=[100.0]).loc[100.0, “B”]) 0.5
ceaf
cea.ceac.ceaf(outcomes, wtp, *, effect=None)Cost-effectiveness acceptability frontier.
At each willingness-to-pay value, identifies the intervention with the highest expected NMB (the optimal choice for a risk-neutral decision maker) and reports its acceptability-curve probability.
Returns
| Name | Type | Description |
|---|---|---|
| pd.DataFrame | DataFrame indexed by wtp with columns intervention (the optimal |
|
| pd.DataFrame | intervention) and prob (its probability of being cost-effective). |
Example
import pandas as pd from heormodel.models import Outcomes from heormodel.cea import ceaf c = pd.DataFrame({“A”: [0.0, 0.0], “B”: [10.0, 10.0]}) e = pd.DataFrame({“A”: [0.0, 0.0], “B”: [1.0, 1.0]}) ceaf(Outcomes.from_wide(c, e), wtp=[100.0]).loc[100.0, “intervention”] ‘B’
expected_loss
cea.ceac.expected_loss(outcomes, wtp, *, effect=None)Expected loss curve: mean foregone net benefit per intervention.
In each iteration, an intervention’s loss is the gap between its net monetary benefit and the best intervention’s in that iteration; the curve is the mean loss over iterations at each willingness-to-pay value. The intervention with the lowest expected loss is the optimal choice, and its expected loss equals the expected value of perfect information, so the curves show both the ranking and the cost of decision uncertainty on one money scale.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| outcomes | Outcomes | Outcomes from a probabilistic sensitivity analysis. | required |
| wtp | ArrayLike | Sequence[float] |
Grid of willingness-to-pay values. | required |
| effect | str | None |
Effect column (default: the primary effect). | None |
Returns
| Name | Type | Description |
|---|---|---|
| pd.DataFrame | DataFrame indexed by wtp with one expected-loss column per |
|
| pd.DataFrame | intervention. |
Example
import pandas as pd from heormodel.models import Outcomes from heormodel.cea import expected_loss c = pd.DataFrame({“A”: [0.0, 0.0], “B”: [10.0, 10.0]}) e = pd.DataFrame({“A”: [0.0, 0.0], “B”: [1.0, -1.0]}) curves = expected_loss(Outcomes.from_wide(c, e), wtp=[10.0]) curves.loc[10.0].round(1).tolist() # loss of A, loss of B [0.0, 10.0]