Functions & Formulae

Each applied formula has its own function page, with a signature, implementations, and tests.

Attributable fraction function for exposed and population cases under confounding

a(p_c, RR_C, p_e, RR_U, r, P_i, Q_i, RR_i) = (AF_e, PAF_M, B_L, GIF, PIF)

Maps a relative risk and an exposure share to the fraction of cases that would not occur without the exposure, among exposed people and across a whole population, and to the fraction that a partial change in exposure would prevent. Levin's population formula and the risk form (R_p minus R_u) / R_p have the algebra of HE-FM-PR-003, which computes them for a crude prevalence ratio; the same form with a risk ratio is Levin's, and HE-EX-PR-008 shows the exposed fraction (PR minus 1) / PR at an exposed share of 1. This package adds what those records do not give, Miettinen's case-based formula, its re-expression from published summary estimates, the relative bias of Levin's formula under confounding and two impact fractions. Applying any of these fractions to aggregate spending is the top-down attributable burden HE-FM-COI-002. The absolute difference R_e minus R_u belongs to the Attributable Risk concept. Notation follows the Attributable Fraction article.

  • Miettinen population attributable fraction from the exposed share of cases

    AF_e = (RR_C - 1) / RR_C; PAF_M = p_c * AF_e

    Multiplies the fraction among the exposed by the share of all cases who were exposed, because removing an exposure cannot prevent cases among unexposed people. The first part, AF_e, takes the form of HE-FM-PR-003 at an exposed share of 1 (HE-EX-PR-008) and of RRR in HE-FM-ARR-002 at the reciprocal ratio, with the exposed group as the comparator. Ferguson and colleagues state that the result equals the true population fraction whatever the degree of confounding, provided RR_C is constant across confounder strata; otherwise the causal relative risk among the exposed is used. Levin's form with the same adjusted ratio (HE-FM-PR-003) equals the true fraction only without confounding, as HE-ER-ATTF-001 shows in numbers. Either result is an excess fraction, the share of cases in excess of those expected without the exposure.

  • Miettinen fraction from population prevalence and two published relative risks

    p_c = p_e * RR_U / (1 + p_e * (RR_U - 1)); PAF_M = p_c * (RR_C - 1) / RR_C

    Recovers the exposed share of cases from the population prevalence and the unadjusted relative risk, then applies HE-FM-ATTF-001 with the causal ratio. The first part is Bayes' rule, the form of PPV in HE-FM-DXA-003 with the exposed risk in place of Se and the unexposed risk in place of 1 minus Sp, and of n_1 divided by N P in HE-FM-PR-004 (derived). Ferguson and colleagues print the whole as a re-expression of Miettinen's estimand, which is practical because unadjusted and adjusted relative risks are often reported together. When RR_U equals RR_C it reduces to Levin's form, HE-FM-PR-003 with the risk ratio in place of the prevalence ratio.

  • Relative asymptotic bias of Levin's formula from prevalence and two relative risks

    C_R = RR_C / RR_U; B_L = C_R * (1 + p_e * (RR_U - 1)) / (1 + p_e * (C_R * RR_U - 1))

    Gives the ratio of Levin's form with the causal ratio (HE-FM-PR-003) to the true fraction HE-FM-ATTF-002, so a published Levin estimate can be judged without the individual data. Ferguson and colleagues derive it as an analytic form of the bias that Darrow and Steenland examined by simulation. A value of 1 means no bias, and below 1 means that Levin's form understates the fraction. B_L is below 1 exactly when C_R is below 1, that is when the crude ratio exceeds the causal ratio, for any prevalence above 0 and below 1 (derived, checked on a grid of 990 cases). C_R is the reciprocal of Darrow and Steenland's confounding risk ratio.

  • Impact fraction for random removal of exposure from a share of exposed people

    GIF = r * p_c * (RR_C - 1) / RR_C

    Scales HE-FM-ATTF-001 by the share r of exposed people from whom exposure is removed, because partial removal affects neither the unexposed cases nor the exposed cases who do not receive the intervention. Khosravi and colleagues call it the generalised impact fraction and print it as this product, and the article's programme step calls the same result a potential impact fraction. It carries the case share and adjusted ratio of Miettinen's formula, so it shares that formula's handling of confounding, which HE-ER-ATTF-016 sets against the prevalence form HE-FM-ATTF-005. At r of 1 it is the population fraction. Multiplying it by aggregate spending is HE-FM-COI-002.

  • Potential impact fraction over exposure levels from a counterfactual distribution

    M_0 = P_0 + P_1 * RR_1 + P_2 * RR_2; M_1 = Q_0 + Q_1 * RR_1 + Q_2 * RR_2; PIF = (M_0 - M_1) / M_0

    Compares the population-average relative risk under the current exposure distribution with the average under a counterfactual one, for a reference level and two exposure levels. M_0 and M_1 have the shape of the chance node average of HE-FM-CHN-001, here on relative risks and not on costs, and RR_0 at the reference level is 1, so it does not appear as a symbol. The last part has the form of VE in HE-FM-ATR-004, with M_1 over M_0 as the ratio. Setting the whole counterfactual at the reference gives the multilevel form of Levin's formula, and a binary exposure then gives the form of HE-FM-PR-003. Khosravi and colleagues warn that this form shares the limitation of Levin's formula under confounding, so with confounding and random partial removal HE-FM-ATTF-004 is the safer choice. Q_i is P'_i in the article.

This set of formulae is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).

Author: Dr Darrin Baines · Publisher: Intelligent Parameters Ltd · Identifier: https://healtheconomics.wiki/concept/attributable-fraction/formulae