Skip to content

voiage.methods.heterogeneity.value_of_heterogeneity

value_of_heterogeneity([positional or keyword] value_array: ValueArray = None, [positional or keyword] subgroups: np.ndarray | list[Any] = None, [positional or keyword] strategy_names: list[str] | None = None, [positional or keyword] n_bins: int | None = None) -> HeterogeneityResult

Calculate the value of tailoring decisions to subgroups.

value_array : ValueArray 2D net-benefit samples with shape (n_samples, n_strategies). subgroups : numpy.ndarray or list[Any] Subgroup label for each sample. strategy_names : list[str], optional Optional strategy labels. n_bins : int, optional Number of quantile bins to use when subgroups is numeric.

HeterogeneityResult Result containing subgroup-specific and overall expected net benefits.

The reported value is the gain from allowing different optimal strategies in different subgroups rather than applying one strategy to everyone:

.. math::

\mathrm{VOH} = \max\left(0,\sum_g w_g \max_d E[NB_{d,g}] - \max_d E[NB_d]\right).

Fenwick, E., Claxton, K., & Sculpher, M. (2001). Representing uncertainty: the cost-effectiveness acceptability curve, the cost-effectiveness acceptability frontier, and the value of heterogeneity. O’Cathain, A., et al. (2021). Equity and subgroup value in economic evaluation.

>>> import numpy as np >>> from voiage.methods.heterogeneity import value_of_heterogeneity >>> from voiage.schema import ValueArray >>> values = np.array([ … [10.0, 8.0], … [11.0, 7.0], … [6.0, 12.0], … [5.0, 13.0], … ]) >>> result = value_of_heterogeneity( … ValueArray.from_numpy(values, [“A”, “B”]), … subgroups=[“low”, “low”, “high”, “high”], … ) >>> result.value >= 0.0 True

Parameters:

  • value_array ValueArray
  • subgroups np.ndarray | list[Any]
  • strategy_names list[str] | None (default: None)
  • n_bins int | None (default: None)

Returns: HeterogeneityResult