When Fairness Metrics Mislead: Demographic Parity Reduces HIV Screening for High-Burden Populations
1Independent Researcher
*Correspondence: Hayden.farquhar@icloud.comAbstract
Background
In clinical contexts where disease burden differs across demographic groups, enforcing demographic parity — equal prediction rates regardless of group — may reduce screening for the populations that need it most. We demonstrate this using HIV testing prediction as a case study.
Methods
Using the Behavioral Risk Factor Surveillance System (BRFSS) 2024 dataset (N=386,775), we trained four classifiers to predict HIV testing uptake and evaluated disparities using demographic parity difference (DPD), equalized odds difference (EOD), and calibration across eight racial/ethnic groups. We applied threshold optimization and exponentiated gradient mitigation and quantified their impact on high-burden populations, including intersectional effects across race and sex.
Results
Baseline selection rates ranged from 12.1% (Asian) to 66.0% (Black), mirroring differential HIV burden (DPD 0.519-0.634). Race-blind models retained 70% of baseline disparity through correlated social determinants. Enforcing demographic parity reduced Black true positive rates from 78.2% to 30.0% (61.6% relative decrease), causing 1,610 additional missed individuals. Race-only optimization worsened sex-based disparity by 71%; multi-objective optimization reduced intersectional DPD from 0.609 to 0.076 but at the same cost to high-burden groups. Exponentiated gradient AUC fell from 0.671 to 0.592 (11.8% relative decrease). Survey-weighted sensitivity analysis confirmed unweighted estimates underestimated disparities.
Conclusions
Demographic parity is an inappropriate fairness criterion in differential-burden clinical contexts because it reduces screening access for high-risk populations. Fairness audits in healthcare should use need-appropriate metrics (equalized odds, calibration) rather than defaulting to demographic parity, and metric selection should involve clinician and community stakeholder deliberation.
Article notes
Competing Interest Statement
The authors have declared no competing interest.
Funding Statement
This study did not receive any funding.
Summary of Updates:
Introduction
Algorithmic Fairness in Healthcare: A Growing Imperative
Algorithmic fairness — whether predictive models perform equitably across demographic groups — is now a standard consideration in healthcare machine learning (ML) (1,2). High-profile examples have catalyzed attention: a widely deployed commercial algorithm for identifying high-risk patients was found to systematically disadvantage Black patients, requiring 2.5 times higher predicted risk to receive equivalent care recommendations (3). Fairness audits have since documented disparities in dermatology AI (4), sepsis prediction (5), and cardiovascular risk scoring (6). Frameworks for quantifying and mitigating algorithmic bias are now well established (7,8).
But one question remains underexamined: which fairness metric should be applied, and when does the choice of metric itself cause harm?
The Metric Selection Problem
The algorithmic fairness literature offers multiple, mathematically incompatible definitions of fairness (9,10). Two dominant paradigms illustrate the tension:
Demographic parity requires equal positive prediction rates across groups regardless of outcome rates. This is appropriate when group membership is irrelevant to the outcome — for example, loan approval, where race should not influence creditworthiness assessment.
Equalized odds requires equal true positive and false positive rates across groups, conditioning on the actual outcome. This is appropriate when base rates legitimately differ across groups — the model should be equally accurate for all groups, but need not select at equal rates.
Calibration requires that predicted probabilities carry the same meaning across groups — among individuals predicted to have 70% probability, approximately 70% should truly be positive regardless of group membership.
These metrics cannot all be satisfied simultaneously when base rates differ across groups (9). In healthcare, base rates — disease prevalence, risk factor distributions, care utilization patterns — frequently differ across demographic groups due to genuine epidemiological variation, structural inequities, or both. The choice among fairness metrics is therefore not merely technical but normative, with direct consequences for patient care.
HIV as a Critical Test Case
Human immunodeficiency virus (HIV) sharply illustrates this problem. HIV burden in the United States is profoundly unequal: Black/African American individuals constitute 13% of the population but account for 42% of new diagnoses; Hispanic/Latino individuals represent 19% of the population but 27% of new diagnoses (11). Black men who have sex with men (MSM) experience the highest incidence of any demographic group (11,12). These disparities reflect structural factors — poverty, insurance gaps, geographic barriers, stigma, and the legacy of systemic racism (12–14) — not biological differences.
ML prediction models are increasingly deployed across the HIV care continuum: identifying candidates for pre-exposure prophylaxis (PrEP) (15,16), predicting viral suppression (17,18), forecasting care retention (19,20), and optimizing prevention resource allocation (21,22). Our systematic search of PubMed (search strategy detailed in Supplementary Materials, Section 6) identified 9,201 articles related to HIV prediction and machine learning published between 2017 and 2026, with 259 specifically addressing ML-based HIV prediction models — yet we identified no comprehensive fairness audit using standard algorithmic fairness metrics.
If demographic parity is applied to HIV testing models — requiring equal testing recommendation rates across racial groups — it would force models to reduce screening recommendations for high-burden populations (Black, Hispanic) and increase them for lower-burden populations (White, Asian). This represents a potential inversion of public health priorities: achieving “statistical fairness” by reducing access for those with the greatest clinical need.
Study Objectives
We conducted a fairness analysis of HIV testing prediction models to demonstrate the consequences of fairness metric selection in a differential-burden context. Our objectives were to:
- Quantify differential prediction rates across racial/ethnic groups in standard ML classifiers trained on nationally representative data
- Demonstrate that race-correlated features perpetuate differential prediction even in race-blind models
- Show that demographic parity optimization reduces screening recommendations for high-burden populations, potentially causing clinical harm
- Characterize the impact of fairness optimization across intersectional groups (race x sex) and demonstrate cross-dimensional trade-offs
- Argue that equalized odds and calibration-based metrics are more appropriate fairness criteria in differential-burden healthcare contexts
Methods
Study Population and Data Sources
Primary Analysis Dataset: BRFSS 2024
We used the Behavioral Risk Factor Surveillance System (BRFSS) 2024 dataset as our primary data source. BRFSS is a nationally representative telephone survey of U.S. adults conducted annually by the CDC, collecting data on health-related risk behaviors, chronic health conditions, and use of preventive services. The 2024 survey included 457,670 respondents across all 50 states and U.S. territories.
From the full survey, we identified 393,676 respondents (86.0%) with valid HIV testing responses. After excluding records with missing demographic information (race/ethnicity, sex, age, region), our final analysis dataset comprised 386,775 adults. After applying additional feature completeness requirements (non-missing values for all predictor variables), the modeling dataset comprised 323,924 adults, which was split into training (N=259,139; 80%) and test (N=64,785; 20%) sets using stratified random sampling to preserve outcome and demographic distributions. The full analysis sample of 386,775 was retained for descriptive statistics and survey-weighted sensitivity analyses.
The primary outcome was HIV testing behavior, defined as ever having been tested for HIV (HIVTST7 variable). Overall, 36.4% of respondents reported prior HIV testing. This outcome captures who has been tested — a measure of historical healthcare utilization — rather than who should be tested based on clinical risk. This distinction is central to our analysis: a model trained on testing uptake learns existing care-seeking and public health targeting patterns, including any biases embedded in those patterns. We examine what happens when fairness metrics are applied to such a model without accounting for this distinction.
Predictor variables included: age (continuous), sex (male/female), race/ethnicity (8 categories: White, Black, Hispanic, Asian, American Indian/Alaska Native [AIAN], Native Hawaiian/Pacific Islander [NHPI], Multiracial, Other), low income status (household income <$25,000), depression diagnosis (ever told by provider), cost barrier to care (could not see doctor due to cost in past 12 months), poor self-rated health status, and geographic region (South vs. Non-South).
The demographic composition of the analysis dataset was: White (73.4%), Hispanic (10.8%), Black (7.8%), Asian (2.8%), Multiracial (2.3%), AIAN (1.4%), Other (0.8%), NHPI (0.5%). HIV testing rates varied substantially by race/ethnicity: Black (56.3%), AIAN (48.9%), Multiracial (48.8%), Hispanic (47.3%), Other (44.4%), NHPI (33.3%), White (32.5%), Asian (24.5%).
Supplementary Demographic Data: NHANES 2017-2018
We obtained demographic and health insurance data from the National Health and Nutrition Examination Survey (NHANES) 2017-2018 cycle (N=9,254 respondents). NHANES provided additional context on demographic distributions, health insurance coverage, depression screening (PHQ-9), and general health status patterns used to validate BRFSS variable coding.
External Validation Data
Ryan White HIV/AIDS Program Data: We obtained aggregate viral suppression rates by race/ethnicity from the 2024 Ryan White HIV/AIDS Program Annual Client-Level Data Report (N=372,220 patients served). This dataset represents the largest federally funded HIV care program in the United States and provides ground truth on clinical outcomes by demographic group, enabling us to assess whether differential prediction rates in our models correspond to genuine differential burden.
CDC AtlasPlus: We extracted state-level HIV surveillance data (N=36,190 records across 13 indicator files) to examine geographic variation in racial disparities. Data included viral suppression rates, new diagnoses, and care continuum metrics by race/ethnicity and state.
AIDSVu: We obtained county-level HIV prevalence and care continuum data (80 files) from Emory University to contextualize geographic patterns in disparities.
Coefficient Audit of Published HIV Risk Scores
To examine explicit race-based risk stratification in existing tools, we reviewed the coefficients of published HIV risk scores:
Denver HIV Risk Score. The Denver HIV Risk Score (23) is a validated point-based instrument for identifying individuals at elevated HIV risk in emergency department settings. The score assigns points for: age 22-25 years (+4), age 26-32 (+6), age 33-46 (+4), male sex (+8), Black race (+7), Hispanic ethnicity (+3), men who have sex with men (+10), injection drug use (+9), and vaginal sex without condom (+5). The score explicitly includes race as a predictor, with Black patients receiving +7 points regardless of behavioral risk factors.
Note: The Denver Score requires behavioral variables (MSM status, injection drug use, condom use) not available in BRFSS. We present the Denver Score as a coefficient audit demonstrating explicit race-based risk stratification, rather than a performance evaluation on our dataset.
Machine Learning Classifiers
We trained four standard ML classifiers to predict HIV testing status: Feature sets included 8 variables: age, sex (male), race_black, race_hispanic, low_income, depression_dx, cost_barrier, and poor_health. For race-blind modeling experiments, we excluded race variables and trained on the remaining 6 features to test whether differential prediction persists through correlated features.
- Logistic Regression (LR): L2-regularized logistic regression with hyperparameter tuning via 5-fold cross-validation
- Random Forest (RF): Ensemble of 100 decision trees with max depth 10, minimum samples per leaf 5
- Gradient Boosting (GB): Gradient boosted trees with learning rate 0.1, max depth 5, 100 estimators
- XGBoost (XGB): Extreme gradient boosting with similar hyperparameters, optimized for performance
Fairness Metrics
We evaluated model fairness using three established metrics from the algorithmic fairness literature (3,7), deliberately comparing their implications:
Demographic Parity Difference (DPD): Measures the difference in positive prediction rates (selection rates) between the most and least selected groups: DPD = max(P(Y_hat=1|A=a)) - min(P(Y_hat=1|A=a)) across all protected attribute values a. A DPD of 0 indicates equal selection rates. DPD does not condition on the outcome and assumes equal selection rates are desirable — an assumption we critically examine.
Equalized Odds Difference (EOD): Measures the maximum difference in true positive rates (TPR) and false positive rates (FPR) across groups: EOD = max(|TPR_a - TPR_b|, |FPR_a - FPR_b|) for all group pairs (a,b). EOD conditions on the actual outcome and captures whether model accuracy is equivalent across groups, independent of base rates.
Calibration: Whether predicted probabilities carry the same meaning across groups, assessed via calibration curves and Brier scores stratified by race/ethnicity.
We also computed:
True Positive Rate Gap: The difference in TPR between specific groups (e.g., TPR_Black - TPR_White), indicating whether positive cases are equally likely to be identified across groups.
Cohen’s h Effect Size: The standardized difference in proportions (selection rates) between groups, with |h|<0.2 considered small, 0.2-0.8 medium, and >0.8 large.
Following established conventions, we considered |DPD| > 0.1 and |EOD| > 0.1 as exceeding acceptable fairness thresholds, though we note that appropriate thresholds depend on clinical context and stakeholder values (9).
Fairness Mitigation Methods
We implemented two categories of fairness interventions, deliberately optimizing for demographic parity to demonstrate its consequences:
Threshold Optimization (Post-processing): This method (24) finds group-specific classification thresholds that optimize a fairness criterion while preserving the underlying model’s predicted probabilities. We optimized for demographic parity, selecting thresholds that equalized positive prediction rates across racial groups.
Exponentiated Gradient (In-processing): This method (25) incorporates fairness constraints directly into model training via Lagrangian-style optimization. The algorithm iteratively adjusts sample weights to satisfy fairness constraints while minimizing classification loss. We used L2-regularized logistic regression as the base estimator for exponentiated gradient (as required by the reductions framework), and tested demographic parity and equalized odds constraints across a range of tolerance parameters (epsilon = 0.001 to 0.2) to characterize the accuracy-fairness Pareto frontier. Performance comparisons between exponentiated gradient and XGBoost baseline therefore reflect both the fairness constraint and the change in base model complexity.
Statistical Analysis and Robustness
Model performance was assessed using area under the receiver operating characteristic curve (AUC), accuracy, precision, recall, F1 score, and Brier score. Fairness metrics were computed using the Fairlearn library. Statistical significance of selection rate differences was assessed using two-proportion z-tests with Bonferroni correction for multiple comparisons (alpha = 0.0167 for three pairwise comparisons).
Robustness was assessed through multiple approaches: Clinical utility was assessed using decision curve analysis (26), comparing net benefit of baseline versus mitigated models across threshold probability ranges.
- Bootstrap resampling (500 iterations) to construct 95% confidence intervals for DPD estimates
- 5-fold cross-validation (N=64,785 per fold) to assess consistency across data splits
- Sensitivity analysis across 10 random seeds to assess stability
- Sensitivity analysis across different base classifiers (LR, RF, GB, XGBoost)
- Sensitivity analysis across constraint tolerance parameters (epsilon from 0.001 to 0.2)
- McNemar’s test to assess whether predictions differed significantly before versus after mitigation
- Chi-square tests for independence between predictions and race
Survey Design Considerations
BRFSS uses a complex survey design with stratification, clustering, and oversampling of certain populations. Our primary analyses treat the sample as unweighted. We acknowledge this as a limitation: unweighted estimates may not reflect nationally representative prevalence or disparity estimates. However, our primary research question concerns the relative behavior of fairness metrics and mitigation methods, which is less sensitive to survey weighting than point prevalence estimation. We discuss the implications of this limitation and the need for weighted replication in the Limitations section.
All analyses were conducted in Python 3.12 using scikit-learn 1.8.0, Fairlearn 0.13.0, XGBoost 3.2.0, and custom analysis pipelines.
Results
Baseline Model Performance
All four ML classifiers achieved moderate discrimination in predicting HIV testing status (Table 1). AUC ranged from 0.671 (Logistic Regression) to 0.714 (Gradient Boosting).
Differential Prediction Rates by Race/Ethnicity
Table 2 presents baseline performance stratified by race/ethnicity for the XGBoost classifier.
Calibration Analysis
Calibration varied across racial groups (Table 4).
The Consequences of Enforcing Demographic Parity
Table 5 presents the central finding: what happens when demographic parity is enforced through mitigation methods.
How Demographic Parity Mitigation Affects High-Burden Groups
Table 6 reveals the clinical consequences of enforcing demographic parity at the group level.
The pattern is striking. Enforcing demographic parity: Equalized odds optimization produced lower overall selection rates and lower TPRs across all groups, reflecting the ThresholdOptimizer’s effort to equalize both TPR and FPR simultaneously — which, given the low baseline FPRs for some groups, required substantial threshold adjustment. The key distinction is conceptual rather than in these particular implementation results: EO as a criterion permits differential selection rates proportional to burden, whereas DP as a criterion forces equal selection rates regardless of burden. The ThresholdOptimizer’s EO implementation here equalized at a low TPR level, but alternative implementations (e.g., in-processing EO with epsilon tuning) could target higher overall sensitivity while maintaining TPR parity.
- Reduced Black TPR from 78.2% to 30.0% — a 48.2 percentage point (61.6% relative) decrease in sensitivity for the group with the highest HIV testing rate and highest disease burden, resulting in 1,610 additional missed individuals in the test set alone
- Reduced Hispanic TPR from 62.6% to 28.3% — a 34.3 percentage point (54.8% relative) decrease, with 1,361 additional missed
- Increased White TPR from 25.2% to 35.4% and Asian TPR from 15.6% to 29.0%
In practical terms, among Black individuals who had been tested for HIV, the baseline model correctly identified 78.2% of them. After demographic parity mitigation, only 30.0% were correctly identified. Extrapolating proportionally to the full BRFSS analysis sample, DP optimization would result in approximately 6,440 additional Black and 5,444 additional Hispanic individuals going unidentified — an approximate but directionally clear estimate of the harm.
Intersectional Impact: Race x Sex
Table 7 presents selection rates across intersectional groups, revealing that demographic parity optimization creates particularly severe consequences at the intersection of race and sex.
Cross-Dimensional Fairness Trade-offs
Optimizing for racial fairness simultaneously degraded sex-based fairness. Sex-based DPD increased from 0.103 (baseline) to 0.176 (after racial DPD optimization) — a 71% worsening (Table 8a). This cross-dimensional transfer of disparity illustrates that single-axis fairness optimization can redistribute rather than eliminate inequity.
To address this, we tested multi-objective optimization approaches that jointly constrain across race and sex (Table 8a).
Statistical Testing
Effect Sizes
Sensitivity Analysis: Survey-Weighted Estimates
BRFSS uses a complex survey design with stratification and oversampling. To assess whether our unweighted analyses biased fairness estimates, we recomputed all metrics using BRFSS survey weights (_LLCPWT). Table S1 compares weighted and unweighted results.
Robustness Analyses
5-Fold Cross-Validation: Mean DPD reduction was 90.9% +/- 3.1% (95% CI: 84.8%-97.1%) across folds. AUC remained stable at 0.711 +/- 0.002.
Random Seed Stability (10 Seeds): Mean DPD reduction was 92.4% +/- 2.5%, with range 87.5%-94.9%.
Bootstrap Confidence Intervals (500 iterations):
Sensitivity to Constraint Parameters: DPD remained stable (0.029-0.054) across epsilon values from 0.001 to 0.2, demonstrating robustness to constraint strength.
Sensitivity to Base Classifier: All four base classifiers showed substantial DPD reduction with threshold optimization: LR (96.8%), RF (88.5%), GB (83.9%), XGB (85.2%).
Coefficient Audit: Denver HIV Risk Score
The Denver Score explicitly assigns differential points by race, with Black patients receiving +7 points and Hispanic patients +3 points regardless of clinical risk factors. A Black male with zero behavioral risk factors scores 15 points (Black +7, male +8) — halfway to the high-risk threshold of 30 — before any clinical assessment. This illustrates explicit race-based stratification in a published HIV risk tool, which may be defensible on epidemiological grounds (reflecting genuine differential incidence) but also embeds demographic profiling into clinical algorithms.
Clinical Utility Analysis
Decision curve analysis showed that mitigated models maintained positive net benefit across clinically relevant threshold ranges (0.30-0.70).
Discussion
Summary of Findings
The choice of fairness metric has direct clinical consequences when disease burden differs across demographic groups. Using HIV testing prediction as a case study, we show three principal findings:
First, standard ML classifiers trained on HIV testing data produce differential prediction rates that closely mirror actual differential testing utilization across racial groups. Selection rates ranged from 12.1% (Asian) to 66.0% (Black), tracking known differences in HIV testing uptake and reflecting the model’s learned representation of existing care patterns. These differential rates exceed conventional fairness thresholds (DPD 0.519-0.634) but do not, by themselves, demonstrate algorithmic bias — they may represent appropriate capture of differential need.
Second, enforcing demographic parity — equal selection rates regardless of group — actively harms high-burden populations. Threshold optimization reduced Black TPR from 78.2% to 30.0%, a 61.6% relative decrease in sensitivity, resulting in 1,610 additional missed individuals in the test set. Black Male selection rates dropped from 66.2% to 17.0% under intersectional optimization. In the context of HIV, where Black MSM have the highest incidence of any demographic group, this represents a concrete reduction in screening access for the population most in need. Exponentiated gradient methods incurred additional performance costs, with AUC decreasing from 0.671 (LR baseline) to 0.592 (11.8% relative decrease).
Third, single-axis fairness optimization transfers disparity across protected dimensions. Optimizing for racial fairness worsened sex-based disparity by 71% (sex DPD from 0.103 to 0.176), demonstrating that fairness is not a single-dimensional property and that optimization on one axis can create new inequities on another. Multi-objective optimization jointly constraining race and sex reduced intersectional DPD from 0.609 to 0.076, but at the same fundamental cost of suppressing selection rates for high-burden subgroups.
Why Demographic Parity Is Wrong for HIV Testing
Demographic parity assumes that the base rate of the outcome should be equal across groups — that any difference in selection rates constitutes unfairness. This assumption is appropriate in contexts like hiring or lending, where membership in a protected group should be irrelevant to the outcome. It is inappropriate in HIV testing for two reasons: The more appropriate fairness criteria for this context are:
- Unequal disease burden is real. Black Americans have 8 times the HIV diagnosis rate of White Americans; Hispanic Americans have 4 times the rate (11). These differences are driven by structural factors, not biology, but they are epidemiologically real. A model that recommends more testing for higher-burden populations is allocating resources toward need, not discriminating.
- The outcome captures differential utilization, not equal need. Our model predicts who has been tested, not who should be tested. Testing rates are higher among Black Americans in part because of decades of targeted public health campaigns in high-burden communities. A model trained on this outcome learns those patterns. Flagging this as “bias” conflates appropriate public health targeting with discrimination. We acknowledge that utilization is an imperfect proxy for need — some utilization differences may reflect access barriers rather than appropriate targeting. However, the directional alignment is clear: groups with higher HIV burden also have higher testing rates, and suppressing those rates through DP optimization moves away from, not toward, appropriate allocation.
- Equalized odds: Ensures the model is equally accurate for all groups — among those who were tested, all racial groups should be equally likely to be identified; among those not tested, all groups should have equal false positive rates. This allows higher selection rates for higher-burden groups while demanding equal accuracy.
- Calibration: Ensures predicted probabilities are accurate across groups — a 60% prediction means the same thing for a Black patient as for a White patient. Our analysis found calibration differences of 0.02-0.04 in Brier scores, indicating room for improvement.
The Harm of Naive Fairness Auditing
Our results illustrate a broader risk in healthcare AI fairness: applying fairness frameworks developed for non-clinical contexts (hiring, lending, criminal justice) to clinical settings where differential treatment may be clinically appropriate. The Obermeyer et al. (3) finding — that a health system algorithm disadvantaged Black patients — has rightly heightened awareness of algorithmic bias. But the lesson should not be “all differential prediction is bias.” The lesson should be “differential prediction is concerning and warrants investigation to determine whether it reflects bias or appropriate clinical variation.”
In our case, the investigation reveals that differential prediction reflects differential testing patterns driven by differential disease burden. Enforcing equality of prediction rates in this context does not correct a bias — it creates a new one, by under-recommending screening for high-risk populations.
This finding has direct parallels to recent work on lung cancer screening, where fairness-motivated revisions to USPSTF eligibility criteria were found to potentially reduce screening access for Black smokers who face higher lung cancer risk at lower pack-year thresholds (27,28).
Mechanisms of Differential Prediction
Our analysis reveals three mechanisms through which models produce differential prediction rates:
Explicit race coding. The Denver HIV Risk Score assigns +7 points for Black race and +3 for Hispanic ethnicity. While this reflects epidemiological data, it means demographic profiling is embedded by design.
Race-correlated features as proxies. Even in race-blind models, features like insurance status, depression, cost barriers, and geography retain 70% of baseline differential prediction. These features are shaped by the same structural inequities that drive differential HIV burden — poverty, geographic segregation, healthcare access.
Whether capturing these associations constitutes “proxy discrimination” or “appropriate capture of social determinants” depends entirely on how the model’s predictions will be used.
Differential calibration. Brier scores were consistently worse for Hispanic patients (0.231-0.251) than White patients (0.199-0.209), indicating that the model’s predictions are less reliable for minority groups. Unlike differential selection rates, this represents a genuine fairness concern: predictions should be equally trustworthy regardless of group membership. Addressing calibration differences — through group-specific calibration, oversampling, or enriched feature sets — would improve model fairness without reducing screening for high-burden populations.
External Validation: Differential Burden Is Real
To contextualize our findings, we compared model-detected differential prediction rates against real-world clinical outcome data from the Ryan White HIV/AIDS Program (N=372,220 patients), the largest federally funded HIV care program in the United States.
Cross-Dimensional Fairness Trade-offs
The finding that racial fairness optimization worsened sex-based fairness (sex DPD increase from 0.103 to 0.176, a 71% degradation) has direct practical implications. Real-world patients belong to multiple protected groups simultaneously. Fairness optimization that considers only one dimension may transfer disparity to another, creating new inequities while resolving old ones. Multi-objective optimization approaches that jointly constrain across multiple protected attributes are needed, but face compounding trade-offs and reduced statistical power for small intersectional subgroups.
Limitations
Several limitations should be considered.
Outcome measure. Our primary outcome was lifetime HIV testing history rather than clinical HIV risk, recent testing, or HIV status. This limits our ability to assess whether differential prediction reflects appropriate risk stratification versus bias. Datasets with HIV diagnosis outcomes (e.g., electronic health records, claims data) would enable need-conditioned fairness analysis using metrics such as equalized odds with clinical outcomes as the ground truth. We note that BRFSS includes a variable for most recent HIV test date (HIVTSTD3), which could be used to derive more proximal measures.
Survey weights. BRFSS uses a complex survey design with stratification, clustering, and oversampling. Our primary analyses treat the data as an unweighted sample.
Sensitivity analysis using BRFSS survey weights (_LLCPWT) showed that weighted estimates yielded slightly larger disparities (DPD 6.7% higher, EOD 6.4% higher), indicating that unweighted analyses underestimate rather than overestimate disparities. All qualitative conclusions were unchanged. However, our weighted analysis used only the final sampling weight and did not incorporate the full complex survey design (stratification and PSU variables) for variance estimation, which may affect confidence interval widths.
Missing behavioral variables. BRFSS does not include behavioral risk variables (MSM status, injection drug use, condom use) that are central to clinical HIV risk assessment. Our models therefore rely on demographic and socioeconomic predictors that are proxies for — rather than direct measures of — HIV risk. This limits the clinical applicability of the models themselves, though it does not undermine our central methodological finding about fairness metric selection.
Limited fairness criteria evaluated. We focused on demographic parity, equalized odds, and calibration. Other criteria — equal opportunity (TPR parity only), needs-proportional allocation, or conditional use accuracy equality — may be more appropriate for specific deployment contexts and should be examined in future work.
Intersectional limitations. Our intersectional analysis examined race x sex (16 groups), but more comprehensive approaches examining interactions with age, geography, insurance status, and sexual orientation would provide additional insight.
Sampling limitations. BRFSS uses telephone-based sampling that may underrepresent populations without stable housing or phone access — precisely those at highest HIV risk.
Future Directions
This work motivates several lines of inquiry:
Need-conditioned fairness analysis. The most important next step is replicating this analysis using datasets with HIV diagnosis outcomes (EHR or claims data), enabling fairness assessment conditioned on clinical need rather than testing utilization. This would allow direct evaluation of whether models over-or under-recommend testing relative to actual risk.
Auditing deployed models. Published HIV screening models — including the Denver Score and recently developed EHR-based PrEP candidacy algorithms (15,16) — should undergo fairness audits using need-appropriate metrics. May et al. (29) recently developed a generalizable HIV risk prediction pipeline across EHR systems that would be a suitable candidate for such an audit.
Stakeholder-driven metric selection. The choice between fairness criteria (demographic parity vs. equalized odds vs. calibration vs. needs-based allocation) involves value judgments that should be informed by clinicians, patients, community advocates, and ethicists — not determined by algorithm developers alone. Participatory approaches to fairness metric selection in HIV prevention are needed.
Multi-dimensional fairness optimization. Methods that jointly optimize across multiple protected attributes (race, sex, age, geography) while respecting clinical priorities warrant development and evaluation.
Conclusions
In healthcare contexts where disease burden differs across demographic groups, the choice of fairness metric is not a technical detail — it is a clinical decision with direct consequences for patient care. We demonstrate that enforcing demographic parity in HIV testing prediction reduces screening sensitivity for Black Americans by 61.6%, resulting in 1,610 additional missed individuals in our test set alone, effectively de-prioritizing the population with the highest HIV burden. Multi-objective optimization across race and sex jointly reduced intersectional disparities but imposed the same fundamental cost. Race-blind models retain 70% of differential prediction through correlated social determinants, but this differential prediction may reflect appropriate capture of need-associated factors rather than bias.
We recommend that fairness audits in healthcare: (1) use need-appropriate metrics — equalized odds and calibration — rather than defaulting to demographic parity; (2) quantify the clinical consequences of mitigation, not just the statistical properties; (3) involve stakeholder deliberation on fairness criteria appropriate to the clinical context; and (4) explicitly examine cross-dimensional trade-offs when optimizing for fairness on a single protected attribute. Algorithmic fairness in healthcare requires clinical judgment, not just mathematical optimization.
Data Availability
The BRFSS 2024 dataset is publicly available from the CDC at https://www.cdc.gov/brfss/. NHANES data are available at https://www.cdc.gov/nchs/nhanes/. Ryan White aggregate data are available from HRSA at https://ryanwhite.hrsa.gov/data/reports. AIDSVu data are available at https://aidsvu.org/. CDC AtlasPlus data are available at https://www.cdc.gov/nchhstp/atlas/. Analysis code is available at https://github.com/hayden-farquhar/HIV-testing-fairness.
Supporting information
Data Availability
All data used in this study are publicly available. The BRFSS 2024 dataset is available from the CDC at https://www.cdc.gov/brfss/. Ryan White HIV/AIDS Program data are available from HRSA at https://ryanwhite.hrsa.gov/data/reports. AIDSVu county-level data are available at https://aidsvu.org/. Analysis code is available at https://github.com/hayden-farquhar/HIV-testing-fairness
Acknowledgments
I gratefully acknowledge the data sources that made this research possible:
- The Centers for Disease Control and Prevention (CDC) for the Behavioral Risk Factor Surveillance System (BRFSS) 2024 dataset and the participants who contributed their health information through this survey
- The National Center for Health Statistics for the National Health and Nutrition Examination Survey (NHANES) data
- The Health Resources and Services Administration (HRSA) for the Ryan White HIV/AIDS Program Annual Client-Level Data, and the patients and providers participating in the Ryan White Program
- AIDSVu (Emory University Rollins School of Public Health) for county-level HIV prevalence and care continuum data
- The CDC National Center for HIV, Viral Hepatitis, STD, and TB Prevention for the AtlasPlus HIV surveillance data
I also acknowledge the developers of the Fairlearn library (Microsoft Research), whose open-source tools enabled the fairness analyses presented in this work.
Ethics Statement
This study used publicly available, de-identified survey data (BRFSS, NHANES) and aggregate program data (Ryan White, CDC AtlasPlus, AIDSVu). No individual-level identifiable data were accessed. The study was exempt from institutional review board review.
Use of AI Tools
AI writing assistance (Claude, Anthropic) was used for manuscript drafting and editing. All analyses, interpretation of results, and scientific conclusions are the sole responsibility of the author. All AI-assisted text was reviewed and revised by the author.
Conflicts of Interest
The author declares no conflicts of interest.
Funding
This research received no external funding.