Functions & Formulae

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

Prevalence ratio function for cross-sectional comparisons and attributable cost inputs

f(P_1,P_0) = PR

Maps the prevalence of a condition among exposed people and among unexposed people, measured at the same time, to their ratio, and carries that ratio into the prevalence odds ratio, a population attributable fraction of prevalent cases and subgroup prevalences for cost-of-illness and budget impact work. Applying the attributable fraction to aggregate annual costs is the top-down attributable burden HE-FM-COI-002, and the attack rate ratio HE-FM-ATR-003 has the same ratio form for new cases in an outbreak. Survey-weighted prevalence and the link between prevalence, incidence and duration are HE-FM-XSD-001 and HE-FM-XSD-002. Notation follows the Prevalence Ratio article.

  • Prevalence ratio from a cross-sectional two-by-two table

    P_1 = a / (a + b); P_0 = c / (c + d); PR = P_1 / P_0

    Divides the proportion of exposed people who have the condition by the proportion of unexposed people who have it, using the four cells of a cross-sectional two-by-two table with exposure in rows. A value of 1 means the condition is equally common in both groups, above 1 more common among the exposed and below 1 less common. Because P_1 cannot exceed 1, the ratio cannot exceed 1 / P_0.

  • Prevalence odds ratio from a prevalence ratio and the unexposed prevalence

    P_1 = PR * P_0; POR = PR * (1 - P_0) / (1 - P_1)

    Converts a prevalence ratio into the prevalence odds ratio that logistic regression reports for the same cross-sectional data, given the prevalence among the unexposed. The cross-product a d / (b c) of the two-by-two table gives the same value. The factor (1 minus P_0) / (1 minus P_1) exceeds 1 whenever P_1 exceeds P_0 and falls below 1 whenever P_1 is lower, so the POR lies further from 1 than the PR whenever the two prevalences differ.

  • Population attributable fraction of prevalent cases from a prevalence ratio

    PAF = e * (PR - 1) / (1 + e * (PR - 1))

    Applies the attributable-risk formula that Jo describes for top-down cost-of-illness studies, with the crude prevalence ratio in place of the relative risk. With cross-sectional evidence the result equals (P minus P_0) / P, the share of prevalent cases in excess of the unexposed prevalence, so it refers to prevalent cases and their annual costs, not to new cases and lifetime costs. Multiplying it by aggregate annual costs gives the top-down attributable burden HE-FM-COI-002.

  • Subgroup prevalences from an overall prevalence, an exposed share and a prevalence ratio

    P_0 = P / (1 + e * (PR - 1)); P_1 = PR * P_0; n_1 = N * e * P_1

    Recovers the prevalence among the unexposed and among the exposed when local records give only the overall prevalence and the exposure mix, and a published PR gives the relative prevalence. It rearranges P = e P_1 + (1 minus e) P_0 with P_1 = PR x P_0, and multiplies the exposed prevalence by the exposed population to size an eligible population for a budget impact analysis.