seismometer.data.performance.calculate_nnt

seismometer.data.performance.calculate_nnt(arr, rho=None)

Calculates NNT (Number Needed to Treat) for the relative risk reduction, rho, and a perfect-ARR (absolute risk reduction), ie PPV.

This formulation and the related ARR and Net Benefit calculation is originally from eotles/med_metrics [1].

Parameters:
  • arr (np.ndarray) – The array of absolute risk reductions for each threshold assuming a rho of 1

  • rho (Number, optional) – The estimated relative risk reduction, by default is DEFAULT_RHO (1/3).

Returns:

the NNT for each threshold.

Return type:

np.ndarray

References