Miettinen population attributable fraction from the exposed share of cases

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.

Signature

AF_e = (RR_C - 1) / RR_C; PAF_M = p_c * AF_e
Inputs
InputsDefinitionUnit
RR_CCausal, confounding-adjusted relative risk of disease in exposed against unexposed people, at least 1 for a harmful exposureratio
p_cProportion of all cases in the population who were exposedproportion
Output
AF_eShare of cases among exposed people that would not occur without the exposureproportion
PAF_MShare of all cases in the population that would not occur without the exposureproportion

Function

Attributable fraction function for exposed and population cases under confounding

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.

Computational function

  • Computational function for attributable fractions from a stratified table of exposed and unexposed cases

    Takes a table of exposed and unexposed people and cases in each confounder stratum and returns the population fraction by counting, the inputs of HE-FM-ATTF-001 and Levin's form for comparison. The expected number of exposed cases without exposure applies each stratum's unexposed risk to its exposed people, the indirect standardisation form of E_h in HE-FM-ALOS-004 on other quantities, and the ratio RR_X is observed over expected, the form of R_h in the same record, here the relative risk standardised to the exposed. RR_U is the form of RR in HE-FM-ATR-003 on risks pooled across strata. L_X and L_U are the form of HE-FM-PR-003 with RR_X and with the crude ratio, and C_A and C_L apply fractions to spending as in HE-FM-COI-002. The chain is written for two strata; the Excel, R and Python take any number.

    Inputs and outputs: x_1, x_2 are exposed people and u_1, u_2 unexposed people in each stratum; a_1, a_2 are exposed cases and c_1, c_2 unexposed cases; k is the cost per case. The chain returns O_e exposed cases, O all cases, E_e expected exposed cases without exposure, PAF_C the fraction by counting, AF_x the fraction among the exposed, p_c the exposed share of cases, RR_X the ratio standardised to the exposed, p_e the population prevalence of exposure, RR_U the crude ratio, L_X and L_U Levin's form with each ratio, B_L the ratio of L_X to PAF_C, and C_A and C_L the attributable cost by counting and by L_X.

    Assumption: As in HE-AS-ATTF-001. The strata hold every confounder, so each stratum's unexposed risk is what its exposed people would have had without the exposure. Each stratum has unexposed people, and each case costs k whichever group it falls in.

    Worked example (article's 100,000 adults): The illustrative table with an illustrative GBP 20,000 per case returns 430 avoidable cases of 1,530, the article's 0.281, 3.6533 and GBP 8.6 million. x_1 = 20000; u_1 = 20000; a_1 = 800; c_1 = 400; x_2 = 6000; u_2 = 54000; a_2 = 60; c_2 = 270; k = 20000; O_e = 860; O = 1530; E_e = 430; PAF_C = 0.281; AF_x = 0.5; p_c = 0.5621; RR_X = 2; p_e = 0.26; RR_U = 3.6533; L_X = 0.2063; L_U = 0.4082; B_L = 0.7342; C_A = 8600000; C_L = 6314286

    Worked example (Ferguson hypertension table per 100,000): The proportions of Table 1 as counts per 100,000, with k = 1 so that C_A reads as cases. The chain returns the published 0.2, 1.5, 1.83 and 0.184. x_1 = 30000; u_1 = 50000; a_1 = 4500; c_1 = 5000; x_2 = 15000; u_2 = 5000; a_2 = 4500; c_2 = 1000; k = 1; O_e = 9000; O = 15000; E_e = 6000; PAF_C = 0.2; AF_x = 0.3333; p_c = 0.6; RR_X = 1.5; p_e = 0.45; RR_U = 1.8333; L_X = 0.1837; L_U = 0.2727; B_L = 0.9184; C_A = 3000; C_L = 2755

    Worked example (Ferguson effect modification): With the probability of disease in the low activity exposed group changed to 0.6, the stratum ratios are 1.5 and 3. The chain returns the correct fraction 0.3846 and the ratio among the exposed 2.25 that Ferguson and colleagues give. x_1 = 30000; u_1 = 50000; a_1 = 4500; c_1 = 5000; x_2 = 15000; u_2 = 5000; a_2 = 9000; c_2 = 1000; k = 1; O_e = 13500; O = 19500; E_e = 6000; PAF_C = 0.3846; AF_x = 0.5556; p_c = 0.6923; RR_X = 2.25; p_e = 0.45; RR_U = 2.75; L_X = 0.36; L_U = 0.4406; B_L = 0.936; C_A = 7500; C_L = 7020

    Excel: Name the stratum columns ExposedPeopleStrata, UnexposedPeopleStrata, ExposedCasesStrata and UnexposedCasesStrata (one row per stratum) and the cost cell CostPerCaseTable. Cells named ObservedExposedCases, CasesAllCounted and ExpectedExposedCases hold =SUM(ExposedCasesStrata), =ObservedExposedCases+SUM(UnexposedCasesStrata) and =SUMPRODUCT(ExposedPeopleStrata*UnexposedCasesStrata/UnexposedPeopleStrata). Cells named PafByCounting, AfByCounting, CaseShareCounted and RatioToExposed hold =(ObservedExposedCases-ExpectedExposedCases)/CasesAllCounted, =(ObservedExposedCases-ExpectedExposedCases)/ObservedExposedCases, =ObservedExposedCases/CasesAllCounted and =ObservedExposedCases/ExpectedExposedCases. Cells named PrevalenceCounted and CrudeRatioCounted hold =SUM(ExposedPeopleStrata)/(SUM(ExposedPeopleStrata)+SUM(UnexposedPeopleStrata)) and =(ObservedExposedCases/SUM(ExposedPeopleStrata))/(SUM(UnexposedCasesStrata)/SUM(UnexposedPeopleStrata)). Cells named LevinToExposedRatio, LevinCrudeRatio and LevinBiasCounted hold =PrevalenceCounted*(RatioToExposed-1)/(1+PrevalenceCounted*(RatioToExposed-1)), =PrevalenceCounted*(CrudeRatioCounted-1)/(1+PrevalenceCounted*(CrudeRatioCounted-1)) and =LevinToExposedRatio/PafByCounting. Cells named CostByCounting and CostByLevin hold =PafByCounting*CasesAllCounted*CostPerCaseTable and =LevinToExposedRatio*CasesAllCounted*CostPerCaseTable. A blank or zero UnexposedPeopleStrata cell returns #DIV/0! in ExpectedExposedCases. With no unexposed cases at all, ExpectedExposedCases is 0 and RatioToExposed returns #DIV/0!, while PafByCounting still returns a number.

    R: paf_table <- function(x, u, a, c, k = 1) { O_e <- sum(a); O <- O_e+sum(c); E_e <- sum(x*c/u); PAF_C <- (O_e-E_e)/O; RR_X <- O_e/E_e; p_e <- sum(x)/(sum(x)+sum(u)); RR_U <- (O_e/sum(x))/(sum(c)/sum(u)); L_X <- p_e*(RR_X-1)/(1+p_e*(RR_X-1)); L_U <- p_e*(RR_U-1)/(1+p_e*(RR_U-1)); c(PAF_C = PAF_C, AF_x = (O_e-E_e)/O_e, p_c = O_e/O, RR_X = RR_X, p_e = p_e, RR_U = RR_U, L_X = L_X, L_U = L_U, B_L = L_X/PAF_C, C_A = PAF_C*O*k, C_L = L_X*O*k) } Called as paf_table(c(20000, 6000), c(20000, 54000), c(800, 60), c(400, 270), 20000) it returns 0.28105, 0.5, 0.56209, 2, 0.26, 3.65327, 0.20635, 0.40823, 0.73422, 8600000 and 6314286 (rounded). With no unexposed cases RR_X and RR_U are Inf and L_X, L_U, B_L and C_L are NaN, while PAF_C is returned. A stratum with no unexposed people gives NaN for PAF_C, AF_x, RR_X, L_X, B_L, C_A and C_L, and an empty table gives NaN throughout. Where PAF_C is 0, B_L is NaN.

    Python: def paf_table(x, u, a, c, k=1): d = lambda n, m: n/m if m else float('nan'); O_e = sum(a); O = O_e+sum(c); E_e = sum(d(i*j, l) for i, j, l in zip(x, c, u)); PAF_C = d(O_e-E_e, O); RR_X = d(O_e, E_e); p_e = d(sum(x), sum(x)+sum(u)); RR_U = d(d(O_e, sum(x)), d(sum(c), sum(u))); L_X = d(p_e*(RR_X-1), 1+p_e*(RR_X-1)); L_U = d(p_e*(RR_U-1), 1+p_e*(RR_U-1)); return dict(PAF_C=PAF_C, AF_x=d(O_e-E_e, O_e), p_c=d(O_e, O), RR_X=RR_X, p_e=p_e, RR_U=RR_U, L_X=L_X, L_U=L_U, B_L=d(L_X, PAF_C), C_A=PAF_C*O*k, C_L=L_X*O*k) Standard library only; paf_table([20000, 6000], [20000, 54000], [800, 60], [400, 270], 20000) returns the same values as the R code. A zero divisor gives NaN and no exception, so no unexposed cases give NaN for RR_X, RR_U, L_X, L_U, B_L and C_L with PAF_C returned; a stratum with no unexposed people gives NaN for PAF_C, AF_x, RR_X, L_X, B_L, C_A and C_L; an empty table gives NaN throughout; PAF_C of 0 gives NaN for B_L.

    Test (Fraction by counting in the article's table): With the first worked example, PafByCounting is compared with the hand value 430 / 1,530 = 0.281. Expected result TRUE. FALSE shows a cell that uses the crude unexposed risk for expected cases (0.4082), a stratum's risk over all its people (0.1484), and a doubled (0.5621) or halved (0.1405) cell. Excel check =ABS(PafByCounting-0.281)<0.0005

    Test (Counting agrees with Miettinen's formula): With the first worked example, PafByCounting is compared with HE-FM-ATTF-001 applied to CaseShareCounted and the ratio of 2 that each age stratum shows, 800 / 20,000 over 400 / 20,000 and 60 / 6,000 over 270 / 54,000. Expected result TRUE. A cell that uses the crude unexposed risk for expected cases (0.4082) gives FALSE, as does a doubled (0.5621) or halved (0.1405) PafByCounting. Excel check =ABS(PafByCounting-CaseShareCounted*(2-1)/2)<1E-9

    Test (Published values of the Ferguson table): With the second worked example, PafByCounting is compared with 0.2 and LevinToExposedRatio with 0.1837, printed as 0.184. Expected result TRUE. Doubling or halving PafByCounting (0.4, 0.1) or LevinToExposedRatio (0.3673, 0.0918) gives FALSE. Excel check =AND(ABS(PafByCounting-0.2)<0.0005,ABS(LevinToExposedRatio-0.1837)<0.0005)

    Common error (Crude unexposed risk for the expected cases): Multiplying all 26,000 exposed people by the crude unexposed risk of 670 in 74,000 gives 235 expected cases and a fraction of 0.4082 against the true 0.2810, because the exposed are older than the unexposed. The unexposed risk must be taken stratum by stratum.

    Common error (Stratum risk over all its people): Using each stratum's risk over exposed and unexposed together gives 633 expected cases and a fraction of 0.1484 against 0.2810, because that risk already contains the exposure's effect.

    Source: Ferguson J, Alvarez A, Mulligan M, Judge C, O'Donnell M. Bias assessment and correction for Levin's population attributable fraction in the presence of confounding. European Journal of Epidemiology. 2024;39(2):111-119. Section A worked example demonstrating the bias in Levin's formula, Table 1, with the counterfactual probabilities applied subgroup by subgroup and a fraction of 0.2; section What if there is effect modification across strata?, the changed probabilities, the correct 0.385 and the ratio of 2.25 among the exposed. Khosravi A, Nazemipour M, Shinozaki T, Mansournia MA. Population attributable fraction in textbooks: time to revise. Global Epidemiology. 2021;3:100062. Section PAF definition, the form (O minus E) / O.

    O_e = a_1 + a_2; O = O_e + c_1 + c_2; E_e = x_1 * c_1 / u_1 + x_2 * c_2 / u_2; PAF_C = (O_e - E_e) / O; AF_x = (O_e - E_e) / O_e; p_c = O_e / O; RR_X = O_e / E_e; p_e = (x_1 + x_2) / (x_1 + x_2 + u_1 + u_2); RR_U = (O_e / (x_1 + x_2)) / ((c_1 + c_2) / (u_1 + u_2)); L_X = p_e * (RR_X - 1) / (1 + p_e * (RR_X - 1)); L_U = p_e * (RR_U - 1) / (1 + p_e * (RR_U - 1)); B_L = L_X / PAF_C; C_A = PAF_C * O * k; C_L = L_X * O * k

Try this function

Implementations

  • Excel

    Miettinen fraction in named cells

    With the inputs in cells named CaseShareExposed and AdjustedRelRisk, the two formulas return, in order, cells named AfAmongExposed and PafMiettinen.

    =(AdjustedRelRisk-1)/AdjustedRelRisk; =CaseShareExposed*AfAmongExposed

Assumptions

  • Causal reading of the association behind a Miettinen fraction

    The exposure causes the disease, confounders are identified from a causal model, and other biases are absent, including measurement bias in the exposure. Removing the exposure leaves the distribution of risk factors it does not affect unchanged, which Khosravi and colleagues call likely to be violated in practice, and a realistic intervention could remove it. These assumptions are set out in their review.

  • Relative risk constant across confounder strata in the Miettinen fraction

    Ferguson and colleagues require the causal relative risk to be constant across joint strata of the confounders. Where it varies, the ratio that gives the true fraction is the causal relative risk among exposed people, the ratio Khosravi and colleagues describe as standardised to the exposed. In the Ferguson effect modification example the overall causal ratio is 2 and the ratio among the exposed is 2.25, and only the second returns the correct 0.385 (HE-EX-ATTF-007).

  • Rate, hazard or odds ratio standing in for the relative risk in rare disease

    Khosravi and colleagues allow an adjusted odds ratio, rate ratio or hazard ratio in place of the adjusted relative risk in the case of rare disease. An odds ratio from a case-control study can then supply the ratio (derived), and cases supply p_c directly, so no population prevalence is needed.

  • Excess fraction and not the etiologic fraction

    The formula estimates an excess fraction. Greenland and Robins state that the excess and etiologic fractions do not necessarily approximate one another and that the etiologic fraction is not generally estimable without strong biologic assumptions.

  • Harmful exposure in the Miettinen fraction

    RR_C is at least 1. Khosravi and colleagues state that the population attributable fraction cannot be used when an exposure is preventive, and they give reverse coding of the exposure or the prevented fraction instead (HE-ER-ATTF-004).

Worked examples

  • Miettinen fraction in the article's 100,000 adults confounded by age

    In the article's illustrative table 860 of 1,530 cases were exposed, so p_c is about 0.5621, and the age-adjusted relative risk is 2. The fraction is 0.281, the same as counting the 430 avoidable cases directly (430 / 1,530). Half of exposed cases would not occur.

    p_c = 0.5621; RR_C = 2; AF_e = 0.5; PAF_M = 0.281
  • Miettinen fraction in the Ferguson hypertension table

    In the hypothetical population of Ferguson and colleagues (Table 1), 60% of cases have hypertension and the causal relative risk is 1.5 in both physical activity strata. The fraction is 0.2, the value they obtain from the definition.

    p_c = 0.6; RR_C = 1.5; AF_e = 0.3333; PAF_M = 0.2
  • Miettinen fraction when every case is exposed

    A limiting case for checking an implementation. With every case exposed the population fraction equals the fraction among the exposed.

    p_c = 1; RR_C = 2; AF_e = 0.5; PAF_M = 0.5

Common errors

  • Levin's formula with an adjusted relative risk under confounding

    Adjusting the relative risk does not remove confounding bias from Levin's form (HE-FM-PR-003). In the article's illustrative table the adjusted ratio of 2 and a prevalence of 0.26 give 0.2063 against the true 0.2810, about 27% low, and an attributable cost of GBP 6.3 million against GBP 8.6 million on GBP 30.6 million of spending. HE-FM-ATTF-003 gives the size of this bias.

  • Population prevalence entered as the exposed share of cases

    p_c is the exposed share of cases, not of the population. Entering the population prevalence of 0.26 from the article's table gives 0.1300 against 0.2810, less than half the true fraction, and GBP 4.0 million against GBP 8.6 million. A prevalence must first pass through HE-FM-ATTF-002.

  • Crude relative risk in the Miettinen fraction

    With a crude ratio the formula carries the confounding. The crude 3.6533 of the article's table gives 0.4082, about 45% above the true 0.2810 and equal to the crude (R_p minus R_u) / R_p, because Miettinen's form with the crude ratio equals Levin's form with the crude ratio (derived). The attributable cost reads GBP 12.5 million against GBP 8.6 million.

  • Protective exposure entered in the attributable fraction

    With a relative risk below 1 the formula returns a negative number. An illustrative protective exposure with p_c of 0.2 and RR of 0.5 gives minus 0.2. Khosravi and colleagues state that the measure cannot be used for a preventive factor and give the prevented fraction (E minus O) / E, equal to PAF / (PAF minus 1), which is 0.1667 here.

  • Exposed fraction read as a probability of causation

    A fraction of 0.5 among the exposed does not give each exposed case a 50% chance of exposure-caused disease. Excess and etiologic fractions need not approximate one another (Greenland and Robins), and in the extreme example of Khosravi and colleagues, where removing the exposure only delays the outcome, the etiologic fraction is 100% and the population fraction is zero.

  • Adding population fractions across risk factors

    Rowe and colleagues explain that each fraction assumes its risk factor is the first to be eliminated, so the fractions describe mutually exclusive scenarios and can sum to more than 1. Where every case needs both of two exposures, removing either prevents all cases, each fraction is 1 and the sum is 2 (derived).

Sources

  • Khosravi review on Miettinen's formula and its assumptions

    Khosravi A, Nazemipour M, Shinozaki T, Mansournia MA. Population attributable fraction in textbooks: time to revise. Global Epidemiology. 2021;3:100062. Section Calculation, equation 4, prints the formula with P_c the prevalence of exposure among cases and gives its decomposition into AF_e times P_c. Section Confounding adjustment allows an adjusted risk, odds, rate or hazard ratio in the case of rare disease. Section Assumptions sets out the causal, other risk factor and realistic intervention assumptions. Section Preventable and prevented fractions gives the preventive case, equations 10 and 11. Section Demystifying PAF and GIF gives AF_e = (RR minus 1) / RR, the Figure 1 cohort and the delayed outcome example.

    View source →

  • Ferguson on Miettinen's expression and constant causal relative risk

    Ferguson J, Alvarez A, Mulligan M, Judge C, O'Donnell M. Bias assessment and correction for Levin's population attributable fraction in the presence of confounding. European Journal of Epidemiology. 2024;39(2):111-119. Section Miettinen's definition of PAF, equation 3, states the expression and that it equals the true fraction irrespective of confounding provided the causal relative risk is constant in joint confounder strata, otherwise with the causal relative risk in exposed individuals. Section A worked example demonstrating the bias in Levin's formula gives Table 1, with a fraction of 0.2 and Levin's 0.184.

    View source →

  • Greenland and Robins on excess and etiologic fractions

    Greenland S, Robins JM. Conceptual problems in the definition and interpretation of attributable fractions. American Journal of Epidemiology. 1988;128(6):1185-1197. The abstract separates the excess, etiologic and incidence-density fractions, states that they do not necessarily approximate one another and that the etiologic fraction is not generally estimable without strong biologic assumptions.

    View source →

  • Rowe and colleagues on fractions that sum past one

    Rowe AK, Powell KE, Flanders WD. Why population attributable fractions can sum to more than one. American Journal of Preventive Medicine. 2004;26(3):243-249. The abstract states that fractions for individual risk factors can sum to more than 1 and that the estimates assume each risk factor is the first to be eliminated, describing mutually exclusive scenarios.

    View source →

Canonical Identity

This formula 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/formula/miettinen-population-attributable-fraction-from-the-exposed-share-of-cases

Miettinen population attributable fraction from the exposed share of cases | HealthEconomics.wiki