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
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
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))
Impact fraction for random removal of exposure from a share of exposed people
GIF = r * p_c * (RR_C - 1) / RR_C
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
