tornado_data

report.tornado_data(
    outcomes,
    draws,
    wtp,
    *,
    intervention=None,
    comparator=None,
    effect=None,
    quantiles=(0.025, 0.975),
)

One-way sensitivity of net monetary benefit, probabilistic or deterministic.

With a parameter draw matrix (the probabilistic path), fits a univariate linear regression of the intervention’s NMB (or incremental NMB versus comparator) on each parameter and evaluates it at the parameter’s outer quantiles. This estimates a one-way analysis from the probabilistic draws.

With a heormodel.dsa (design, descriptor) pair from one_way or one_at_a_time (the DSA path), reads the NMB at each parameter’s lowest and highest swept value directly, ignoring quantiles.

Returns

Name Type Description
pd.DataFrame DataFrame indexed by parameter with columns low, high and
pd.DataFrame span, sorted by descending span.

Example

import numpy as np, pandas as pd from heormodel.models import Outcomes from heormodel.report import tornado_data rng = np.random.default_rng(0) x = rng.normal(size=500) draws = pd.DataFrame({“x”: x}, index=pd.RangeIndex(500, name=“iteration”)) out = Outcomes.from_wide( … pd.DataFrame({“A”: -x}), pd.DataFrame({“A”: np.zeros(500)})) td = tornado_data(out, draws, wtp=1.0, intervention=“A”) td.index[0] ‘x’