1. Home
  2. Explore
  3. Statistics
  4. Biostatistics and Health Data Science

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Biostatistics and Health Data Science

Machine Learning in Healthcare: Methods, Generalizability, Fairness, and Policy

Machine learning in healthcare is not merely a technical exercise. Healthcare data represent real people, families, suffering, unequal access, and the effects of social institutions. Because algorithms can influence diagnosis, treatment, insurance payments, resource allocation, and policy, they must be developed and evaluated with unusually high standards.

A central principle is that healthcare data are too important to treat as a toy problem. A methodologically sophisticated algorithm is not useful if it is based on poor data, answers the wrong question, cannot be implemented, or produces harms for marginalized groups.


1. A Responsible Perspective on Machine Learning in Healthcare

1.1 Combining statistical and applied expertise

Effective healthcare data science requires understanding both:

  • Statistical and machine learning methodology

  • The healthcare problem and its institutional context

A researcher trained only in statistics may develop a technically elegant method that does not address the real needs of patients, clinicians, insurers, or policymakers. Conversely, a clinically trained researcher may apply an algorithm without understanding its assumptions, limitations, or failure modes.

Deep engagement with the applied field allows researchers to:

  • Identify meaningful research questions

  • Understand how data are generated

  • Recognize important sources of bias

  • Choose outcomes that matter clinically or socially

  • Evaluate whether a method is realistic in practice

  • Translate statistical results into policy or clinical decisions

Interdisciplinary training may take substantial time, but it enables researchers to solve real problems that cannot be addressed from within a single discipline.

1.2 Methodological theory and practical feasibility

A machine learning system can be viewed as taking data and substantive knowledge as inputs. Its development should be guided by:

  • Explicitly specified benchmarks

  • Methodological and statistical theory

  • Computational feasibility

  • Usefulness in the intended setting

  • Translational potential

A theoretically optimal method may still fail if it is:

  • Too computationally expensive

  • Impossible to implement in the available healthcare system

  • Incompatible with the data-generating process

  • Difficult for clinicians or policymakers to interpret

  • Not sufficiently reliable for deployment

The goal is therefore not simply to maximize predictive performance in an abstract setting. The goal is to produce a method that is valid, feasible, useful, and safe in practice.

1.3 Diversity and team composition

Research teams should reflect the populations they serve. Homogeneous teams can overlook:

  • Important research questions

  • Relevant outcomes

  • Sources of harm

  • The experiences of underrepresented populations

  • Appropriate ways to evaluate an algorithm

  • Differences in how an intervention affects social groups

Diversity matters throughout the research pipeline, including:

  1. Choosing the research problem

  2. Obtaining funding

  3. Defining the study population

  4. Collecting and processing data

  5. Selecting statistical methods

  6. Evaluating performance

  7. Deciding whether and how to deploy the tool

  8. Monitoring consequences after deployment

1.4 Human meaning behind data

Every data point corresponds to a person’s experience. Healthcare data may represent:

  • Illness

  • Disability

  • Financial hardship

  • Family responsibilities

  • Restricted access to care

  • Treatment decisions

  • Pain or suffering

  • Death

Data should not be treated merely as a resource for publishing papers or advancing careers. Researchers have an ethical responsibility to ensure that the use of health data is respectful, relevant, and directed toward meaningful improvements in health and healthcare.

Key principle: Behind every data point is a human story, a family, and potentially suffering. Statistical work should be conducted with respect for the people represented in the data.


2. Healthcare Data: Sources, Strengths, and Limitations

The increasing availability of electronic health information has created major opportunities for health research. However, the usefulness of a data source depends on the specific research question. A dataset that is valuable for one purpose may be inadequate for another.

The quality, completeness, representativeness, and biases of the data may matter more than the sophistication of the statistical method applied to them.

2.1 Electronic health records are not a single type of data

The label electronic health record, or EHR, is often used broadly to describe several distinct data types. These sources differ in how they are collected, what they measure, and which research questions they can answer.

Clinical record data

Clinical records may include:

  • Diagnoses

  • Symptoms

  • Laboratory results

  • Medications

  • Clinical notes

  • Procedures

  • Imaging

  • Vital signs

  • Other information recorded during patient care

Strengths:

  • Rich clinical information

  • Potentially detailed information about disease and treatment

  • Direct relevance to clinical decision-making

Limitations:

  • Records are often not integrated across healthcare systems

  • Patients may receive care at multiple institutions

  • Information may be missing when care occurs elsewhere

  • Documentation practices vary across clinicians and institutions

  • The data are collected primarily for care, not research

Billing claims data

Billing claims are generated to support payment and reimbursement rather than to provide a complete clinical description of a patient.

Strengths:

  • Very large sample sizes

  • Broad coverage of healthcare utilization

  • Information about diagnoses, procedures, services, and payments

  • Useful for studying healthcare spending and utilization

Limitations:

  • Limited clinical detail

  • Diagnoses may be recorded for billing purposes

  • Important symptoms, severity measures, and clinical reasoning may be absent

  • Coding practices can vary across time and institutions

  • Patients must have an encounter with the healthcare system to appear in the data

  • Absence of a code does not necessarily indicate absence of a condition

Claims data may be useful for narrowly defined questions, but they are often inappropriate for causal questions that require detailed information about disease severity, treatment decisions, or unmeasured confounding.

Clinical registries

Clinical registries usually focus on a particular disease, procedure, or population.

Strengths:

  • Detailed, disease-specific clinical information

  • Often include information not available in claims

  • Useful for studying treatment characteristics and clinical outcomes

Limitations:

  • May include only short-term outcomes

  • May cover a selected group of patients

  • May require linkage to vital statistics or other sources to measure long-term outcomes

  • Results may not generalize beyond the registry population

Survey data

Surveys are often designed around a specific research question.

Strengths:

  • Tailored measurement of attitudes, behaviors, experiences, symptoms, or social factors

  • Can collect information not routinely recorded in clinical systems

  • May capture patient-reported outcomes

Limitations:

  • Usually smaller sample sizes

  • Recall bias

  • Nonresponse bias

  • Reporting error

  • Difficulty following participants over long periods

Government data

Government sources can provide information unavailable in individual clinical records, such as:

  • Neighborhood characteristics

  • Economic indicators

  • Population-level health measures

  • Crime statistics

  • Environmental exposures

  • Geographic and policy variables

These data are often available only at an aggregated level, such as:

  • ZIP code

  • Census tract

  • County

  • State

Government data can be linked to individual records through geographic identifiers, but they must be interpreted carefully. Aggregated measures do not necessarily describe the individual accurately.

Government datasets may also contain institutional and societal biases. For example, crime statistics reflect not only crime itself but also:

  • Where police are present

  • Which communities are surveilled

  • Which behaviors are reported

  • How law enforcement records incidents

  • Differences in reporting and enforcement across communities

Wearable and implantable technologies

Wearable devices and implantable sensors can produce highly granular measurements, such as:

  • Physical activity

  • Heart rate

  • Sleep

  • Movement

  • Physiological signals

  • Device-specific clinical measurements

Strengths:

  • Frequent or continuous measurement

  • Less reliance on participant recall

  • Ability to capture behavior in everyday settings

  • Fine-grained temporal information

Limitations:

  • Measurement error

  • Device-specific limitations

  • Unequal access to technology

  • Differences in adherence or device use

  • Uncertain representativeness of users

For example, an accelerometer may measure steps reasonably well but measure distance poorly. A device can therefore provide precise-looking data that do not accurately represent the construct of interest.

Digital data

Digital data may include:

  • Internet search behavior

  • Social media activity

  • Online interactions

  • Mobile phone information

  • Other digital traces

Strengths:

  • Potentially timely

  • May capture populations not represented in healthcare encounters

  • Can provide information unavailable in traditional health datasets

  • May be particularly useful in regions with limited healthcare infrastructure

Limitations:

  • Noise

  • Measurement ambiguity

  • Changing platform behavior

  • Unequal internet access

  • Unclear relationship between online activity and health status

  • Potential privacy concerns

Digital data should be approached skeptically, but novelty alone is not a reason to dismiss them.

News media data

News media can provide rapid information about emerging events and disease outbreaks.

Strengths:

  • Timeliness

  • Early detection of outbreaks

  • Often shorter delays than official healthcare reporting systems

  • Useful when formal surveillance systems have long reporting lags

Limitations:

  • Media attention is selective

  • Reports may be incomplete or inaccurate

  • Coverage varies across geography and population

  • News reporting reflects editorial and societal biases

News media data became especially important during the COVID-19 pandemic because they could provide information before slower formal systems became available.

Medical imaging

Medical imaging, including MRI and other imaging modalities, is often integrated into clinical record systems. It can also be considered a form of digital data because it consists of digitally stored measurements and images.

Imaging data provide rich information but require attention to:

  • Image quality

  • Scanner and institution differences

  • Protocol variation

  • Annotation quality

  • Measurement and classification error

  • Representativeness of patients receiving imaging

2.2 Data sources are porous and overlapping

These categories are not mutually exclusive. For example:

  • An MRI may be stored in a clinical record and analyzed as digital data

  • A clinical registry may link to claims

  • Survey responses may be linked to EHR data

  • Government data may be linked at the ZIP-code level

  • Wearable data may be combined with clinical records

The value of combining sources depends on whether the linkage is accurate and whether the combined data provide the information needed for the research question.

2.3 Healthcare encounters determine who appears in many datasets

Claims and clinical records generally require a person to interact with the healthcare system. People who lack an encounter may be absent from the data because of:

  • Lack of insurance

  • Cost barriers

  • Geographic isolation

  • Distrust of healthcare institutions

  • Limited availability of providers

  • Transportation difficulties

  • Cultural or language barriers

  • Choosing not to seek care

This creates selection bias. The observed population may differ substantially from the population of interest.

A digital dataset may include some people who do not appear in healthcare records, but digital data have their own coverage and measurement problems. No data source should automatically be treated as a universal or unbiased “gold standard.”

2.4 Choosing data for a research question

Before selecting a statistical method, researchers should ask:

  • What exactly is the scientific question?

  • Which population is of interest?

  • What outcome must be measured?

  • How accurately does the dataset measure that outcome?

  • Which people are missing from the data?

  • How were the data generated?

  • What biases are embedded in the collection process?

  • Is the data source suitable for causal inference, prediction, clustering, or another task?

  • Can the data support the intended interpretation?

Key principle: Better algorithms cannot compensate for data that do not measure the relevant variables or represent the population of interest.


3. Generalizability and Dataset Shift

Generalizability concerns whether findings or algorithms remain valid when applied beyond the original study setting.

It applies to multiple research goals, including:

  • Inference

  • Prediction

  • Clustering

  • Causal effect estimation

  • Policy evaluation

3.1 Generalizing and transporting effects

In causal inference, researchers may want to:

  • Generalize results from a randomized trial to a broader target population

  • Generalize results from an observational study to a target population

  • Transport treatment effects from one population to another

For example, an effect estimated among Medicaid beneficiaries in New York may not automatically apply to Medicaid beneficiaries in Texas. The states may differ in:

  • Demographics

  • Disease prevalence

  • Healthcare access

  • Provider systems

  • Medicaid policies

  • Insurance enrollment patterns

  • Social and economic conditions

Transporting an effect requires examining whether the relevant characteristics and causal relationships are sufficiently similar, or whether statistical adjustment can account for the differences.

3.2 Generalizability of prediction algorithms

Prediction studies frequently make overly broad claims. A common pattern is:

  1. Use one year of data

  2. Study patients at one healthcare center

  3. Fit a prediction algorithm

  4. Evaluate it using internal cross-validation

  5. Report a single metric such as AUC

  6. Claim that the algorithm is ready for widespread use

This approach is often inadequate.

Internal versus external evaluation

Internal validation evaluates performance using data related to the development sample, such as through cross-validation or bootstrap methods.

External validation evaluates the algorithm in a genuinely separate setting, such as:

  • A different hospital

  • A different geographic region

  • A later time period

  • A different patient population

  • A separate healthcare system

External evaluation is essential because an algorithm may perform well in development data but fail when:

  • Coding practices differ

  • Patient characteristics differ

  • Clinical workflows differ

  • Disease prevalence changes

  • Measurement procedures change

  • The healthcare system changes

Limitations of single-metric leaderboards

A single global metric, such as the area under the receiver operating characteristic curve, may hide important problems.

A model can have a strong overall AUC while performing poorly for:

  • A racial or ethnic group

  • Older adults

  • People with disabilities

  • Rural patients

  • Patients with multiple conditions

  • Patients with rare but important outcomes

Prediction evaluation should examine multiple dimensions, including:

  • Discrimination

  • Calibration

  • Sensitivity

  • Specificity

  • Positive predictive value

  • Negative predictive value

  • Performance across clinically relevant subgroups

  • Stability across time and settings

  • Clinical consequences of errors

Pilot studies versus deployment-ready systems

Many published prediction studies should be interpreted as pilot studies, not as evidence that a tool is ready for widespread use.

A pilot study can establish that:

  • A prediction task is feasible

  • A signal may exist

  • A particular data source may be informative

  • Further validation is justified

It does not necessarily establish that:

  • The algorithm is safe

  • The algorithm generalizes

  • The algorithm improves care

  • The algorithm is fair

  • The algorithm should be deployed broadly

3.3 Dataset shift

Dataset shift occurs when the distribution or meaning of the input data changes between model development and deployment.

This can happen even when the underlying population appears stable. Causes include:

  • Changes in coding practices

  • Changes in reimbursement rules

  • Changes in diagnostic criteria

  • Changes in clinical workflows

  • Changes in available technology

  • Changes in treatment patterns

  • Changes in healthcare access

  • Changes in disease prevalence

An algorithm trained on historical data may therefore encounter a different data-generating process after deployment.

Coding instability in claims data

Chronic conditions are often represented through diagnosis codes. However, the presence or absence of a code is not equivalent to the true presence or absence of disease.

A patient may have a condition but fail to receive the corresponding code because:

  • The condition was not discussed during the encounter

  • The condition was not relevant to billing

  • The patient received care elsewhere

  • Coding priorities changed

  • The condition was incorrectly documented

  • The patient had no encounter during the period

Conversely, a code may appear even when the condition is uncertain or incorrectly recorded.

Some conditions are coded more consistently because they require regular healthcare encounters. For example, people with diabetes may have frequent visits and ongoing disease management, making diabetes codes relatively persistent.

Other conditions may be coded much less consistently. A person coded as having paraplegia in one year may not receive the same code in the following year, even though the underlying condition has not changed.

Important distinction: The presence of a diagnosis code does not guarantee that the patient has the condition, and the absence of a code does not prove that the patient does not have it.

Coding becomes even more difficult when patients have multiple chronic conditions, particularly older adults with complex health needs. An algorithm based on claims data must account for both misclassification and inconsistent recording.


4. Familiar Statistical Questions in New Healthcare Settings

Many healthcare problems use familiar statistical ideas, but the consequences of errors can be unusually large. Prediction, variable selection, causal inference, and fairness all acquire special importance when they affect health insurance, treatment, or public policy.


4.1 Plan payment risk adjustment

Risk adjustment is a system for redistributing payments among health insurers according to the expected healthcare costs of their enrollees.

Its intended purpose is to encourage insurers to compete on:

  • Efficiency

  • Quality

  • Service

  • Care coordination

Rather than competing by avoiding people likely to have high healthcare costs, insurers should receive payments that reflect the health needs of their members.

Risk adjustment as a prediction problem

A typical risk adjustment model predicts healthcare spending using:

  • Demographic variables, such as documented sex and age category

  • Binary indicators for health conditions

  • A vector of coefficients, often called risk-adjustment weights

The general form can be represented as:

Y^=Xβ^\widehat{Y} = X\widehat{\beta}Y=Xβ​

where:

  • YYY is healthcare spending

  • XXX is the vector of demographic and health-condition indicators

  • β^\widehat{\beta}β​ is the estimated coefficient or weight vector

  • Y^\widehat{Y}Y is predicted spending

The predicted amount influences the payment an insurer receives for an enrollee.

Because millions of people are enrolled in programs using risk adjustment, even small changes in predicted spending can produce enormous financial effects.

4.2 Upcoding incentives

If an insurer receives additional payment when an enrollee is assigned a condition code with a positive risk-adjustment weight, the insurer may have an incentive to record as many qualifying conditions as possible.

This behavior is called upcoding.

Upcoding may involve:

  • Recording conditions more frequently

  • Recording more severe versions of conditions

  • Documenting diagnoses that are not clinically well supported

  • Increasing the number of risk-adjustment conditions attached to a patient

Some forms may be legal within the rules of the payment system, while others may violate regulations.

The basic financial logic is:

Payment∝Predicted spending\text{Payment} \propto \text{Predicted spending}Payment∝Predicted spending

and if additional diagnosis codes increase predicted spending, they can increase payments.

Upcoding creates a conflict between:

  • Accurate clinical documentation

  • Financial incentives

  • Fair allocation of public or insurance funds

4.3 Reducing the number of risk adjusters

One line of research examined whether risk adjustment could use a smaller set of variables to reduce opportunities for upcoding.

In a commercially insured population, a data-adaptive machine learning approach using a limited set of 10 variables achieved approximately 92% of the efficiency of the larger standard model.

This result was surprising because it suggested that a much simpler formula might preserve most predictive performance while reducing the number of coding opportunities.

However, the finding did not generalize to Medicare.

Failure to generalize to Medicare

When the same broad strategy was evaluated in Medicare:

  • The limited-variable risk adjustment algorithms performed consistently worse

  • The variables selected in the commercial population were not appropriate for Medicare

  • Rebuilding a subset-based model specifically using Medicare data still did not produce the desired performance

This demonstrates that both of the following may fail to generalize:

  1. A fixed model or selected set of variables

  2. The process used to develop the model

Researchers may assume that even if a particular formula does not transfer, the model-building procedure will transfer. The Medicare results show that this assumption is not guaranteed.

Importance of the target population

The Medicare population includes:

  • Adults aged 65 and older

  • Younger individuals with disabilities

  • Individuals with end-stage renal disease

Older adults and people with complex health conditions are often excluded from or underrepresented in research. Results developed in commercially insured populations may therefore be inappropriate for Medicare.

The target population must be considered from the beginning of study design, not only after a model has been built.

4.4 Prediction using apparently “wrong” data

Risk adjustment formulas for some insurance programs are developed using data that do not exactly match the population in which the formula is applied.

Examples include:

  • Commercial insurance data used for health insurance marketplace risk adjustment

  • Traditional Medicare data used for Medicare Advantage risk adjustment

These populations differ.

Marketplace enrollees differ from people with employer-sponsored insurance because the two groups face different eligibility and enrollment processes. Similarly, Medicare Advantage enrollees are not identical to people in traditional Medicare. Medicare Advantage enrollees have historically tended to be younger and healthier, although the population is becoming more medically complex as enrollment increases.

Researchers constructed matched samples intended to more closely resemble the populations in which the formulas were used. In the examined settings, results were unexpectedly similar whether the original data or the adjusted samples were used.

This suggests that using a nonidentical data source is not always harmful, but the conclusion is limited:

  • It was based on only a small number of empirical examples

  • Population differences may become more important over time

  • The result may not apply to other settings

  • Similar average performance may conceal subgroup-specific problems


5. Algorithmic Fairness in Healthcare

Fairness is a broad concept that affects:

  • Research question selection

  • Study design

  • Data collection

  • Inference

  • Prediction

  • Clustering

  • Algorithm assessment

  • Deployment

  • Post-deployment monitoring

5.1 Questions that determine fairness

Responsible algorithm development requires asking:

  • Who chose the research question?

  • Who benefits from answering it?

  • Who is included in the target population?

  • Who is missing?

  • What do the data actually reflect?

  • Which social inequalities are encoded in the data?

  • How will performance be measured?

  • Which errors matter most?

  • Will the algorithm work equally well across groups?

  • Who is responsible if the algorithm causes harm?

Fairness is therefore not just a technical adjustment made after model fitting. It begins before any algorithm is developed.

5.2 Structural inequality in healthcare data

Healthcare data may reflect:

  • Structural racism

  • Unequal access to healthcare

  • Rural provider shortages

  • Lower access in low socioeconomic-status communities

  • Differences in insurance coverage

  • Unequal diagnostic opportunities

  • Differences in treatment patterns

  • Historical discrimination

An algorithm trained on these data may reproduce or amplify existing inequities.

A model may appear objective because it uses numerical data, but the data themselves are generated by social systems that are not neutral.

5.3 Performance differences across groups

Technologies do not necessarily perform equally for all groups. A well-known example from facial recognition research showed substantially worse classification accuracy for women, particularly women with darker skin tones.

The broader lesson is that aggregate performance can conceal severe subgroup disparities. Similar problems can occur in healthcare algorithms when:

  • Training data underrepresent certain groups

  • Measurement quality differs across groups

  • The outcome is defined differently across groups

  • Healthcare access affects whether disease is recorded

  • The model learns historical treatment patterns rather than biological need

5.4 Exclusion from clinical trials

Fairness problems also arise through study design, not only through algorithms.

Some racial and ethnic groups have been underrepresented in cancer clinical trials even when the cancers being studied disproportionately affect those groups. This limits the ability to determine whether treatments work equally well across populations.

Older adults are another frequently excluded group. During the COVID-19 pandemic, older adults were excluded from a substantial proportion of clinical trials and from all vaccine trials examined in one analysis.

This exclusion is particularly concerning because older adults represented:

  • Approximately 9% of the United States population

  • Roughly 30–40% of COVID-19 cases

  • At least 80% of COVID-19 deaths

A population that experiences a large share of disease and mortality should not be routinely excluded from the evidence base used to guide treatment and prevention.

Key principle: Randomized trials are valuable, but they are not automatically representative. A trial’s status as a “gold standard” does not eliminate concerns about exclusion and generalizability.


6. Stages of Fairness-Aware Algorithm Development

Fairness interventions can be organized into three broad stages:

  1. Pre-processing

  2. Model fitting

  3. Post-processing

6.1 Pre-processing

Pre-processing methods modify the data before model fitting. They may include:

  • Data transformations

  • Reweighting observations

  • Correcting measurement differences

  • Removing or adjusting biased features

  • Constructing a more balanced training dataset

The goal is to reduce the influence of societal bias in the data.

However, simply removing a protected attribute may not remove bias. Other variables may act as proxies for that attribute, and the underlying outcome may already reflect unequal treatment or access.

6.2 Fitting-stage interventions

Fitting-stage methods modify the algorithm or objective function while the model is being trained. They may include:

  • Adding or removing variables

  • Training separate formulas for different groups

  • Using fairness-aware statistical learning methods

  • Adding constraints to the loss function

  • Penalizing disparities in predicted outcomes or errors

A common instinct is to add more variables in hopes that the algorithm will become more accurate and fair. This can fail because additional variables may encode historical inequalities and create a feedback loop that reproduces bias.

More information is not automatically better information.

6.3 Post-processing

Post-processing occurs after the algorithm has been fitted and may include:

  • Adjusting predictions

  • Calibrating outputs

  • Using different decision thresholds for different groups

  • Changing the classification rule from predicted probability to a final zero-or-one decision

For example, a classification system may use group-specific thresholds to account for differences in error rates or calibration.

Post-processing can improve selected fairness measures, but it must be evaluated carefully because improving one metric may worsen another.


7. Formalizing Group Fairness

Suppose:

  • YYY is the observed outcome

  • XXX is a vector of predictors

  • AAA is a protected or sensitive attribute

  • f^(X)\widehat{f}(X)f​(X) is a prediction function

The goal is to estimate a function relating XXX to YYY while ensuring that the function performs fairly across groups defined by AAA.

A protected group may be represented as the set of individuals for whom AAA takes a particular value. Fairness metrics can then be calculated separately for:

  • Members of the protected group

  • Individuals outside that group

Common group fairness concepts compare groups on:

  • Predicted outcomes

  • Prediction errors

  • Calibration

  • False-positive rates

  • False-negative rates

  • Sensitivity and specificity

  • Financial consequences of predictions

No single fairness metric is universally correct. The appropriate measure depends on the decision context and the harms the algorithm could create.

7.1 Net compensation in risk adjustment

In risk adjustment, a relevant fairness measure is net compensation:

Net compensation=Predicted spending−Observed spending\text{Net compensation} = \text{Predicted spending} - \text{Observed spending}Net compensation=Predicted spending−Observed spending

Interpretation:

  • A negative value means the insurer is undercompensated

  • A positive value means the insurer is overcompensated

  • An average negative value for a group may create an incentive to avoid enrolling members of that group

If individuals in a particular group consistently cost more than the risk adjustment model predicts, insurers may lose money by covering them. This can encourage indirect discrimination.

Discrimination may occur through:

  • Benefit design

  • Drug formulary placement

  • Provider network composition

  • Prior authorization practices

  • Administrative barriers

  • Marketing or enrollment strategies


8. Mental Health, Substance Use, and Fairness in Insurance

Mental health is an important example of the consequences of unfair risk adjustment.

Mental healthcare improved substantially over time not only because of new treatments but also because of:

  • Increased financing

  • Greater consumer choice

  • Increased competition among providers

  • Changes in how mental healthcare was organized

This demonstrates that financing and institutional design can be as important as treatment technology.

Mental health conditions have major economic consequences:

  • They represent the highest category of total healthcare costs

  • They rank near the top in spending growth

  • Approximately one in five people has a mental health condition

  • Substance use disorders may also involve high and unpredictable costs

8.1 Underrecognition in risk adjustment

A marketplace risk adjustment system recognized only approximately 20% of enrollees with mental health or substance use disorders.

This means that the majority of people with these conditions were not appropriately represented in the payment model. Since these individuals may have higher healthcare costs, insurers may be systematically undercompensated for covering them.

The resulting incentive is not necessarily explicit refusal of coverage. Insurers may instead make their plans less attractive or less accessible to affected patients.

Possible mechanisms include:

  • Placing psychiatric medications in higher cost-sharing tiers

  • Restricting provider networks

  • Limiting access to mental health specialists

  • Designing benefits that are less useful to people with complex behavioral health needs

This illustrates how a statistical model can contribute to discrimination even when it does not explicitly use a protected characteristic.


9. Fair Regression and Constraint-Based Methods

One strategy for improving fairness is to incorporate fairness requirements directly into the model-fitting objective.

A standard regression model minimizes prediction error. A fairness-aware model can minimize prediction error while also penalizing disparities or imposing constraints.

A general objective can be represented as:

Loss=Prediction error+λ×Fairness penalty\text{Loss} = \text{Prediction error} + \lambda \times \text{Fairness penalty}Loss=Prediction error+λ×Fairness penalty

where:

  • The prediction error measures how poorly spending or outcomes are predicted

  • The fairness penalty measures disparity across groups

  • λ\lambdaλ controls the importance assigned to fairness

A larger λ\lambdaλ places greater emphasis on reducing disparities, potentially at the cost of some predictive accuracy.

9.1 Trade-off between prediction and fairness

Fairness-aware methods do not necessarily require a large sacrifice in predictive performance.

In the risk adjustment example:

  • Standard and fairness-aware methods had similar R2R^2R2 values

  • The reduction in R2R^2R2 was approximately 4% relative to ordinary least squares

  • Predictive efficiency remained within a range typical for risk adjustment

  • Net compensation improved dramatically for an undercompensated group

The group’s average undercompensation fell from nearly 2,000 to approximately 46. The original undercompensation represented about 16% of mean spending, making it financially and socially substantial.

This demonstrates that a model can retain most of its predictive performance while substantially improving the distributional consequences of its predictions.

9.2 Simulation and model misspecification

Simulation studies are useful for testing whether a method works under controlled conditions, including situations involving:

  • Complex relationships between variables

  • Incorrect model assumptions

  • Model misspecification

  • Different levels of group imbalance

  • Various forms of outcome heterogeneity

A method that performs well only under simple assumptions may not be reliable in real healthcare data. Robustness across complex scenarios provides stronger evidence.

9.3 Fairness improvements can affect multiple groups

Improving fairness for one group should not create new disadvantages for another group.

A broader approach combined:

  • Variable selection

  • Fairness metrics

  • Post-processing methods

  • Other algorithmic adjustments

Improving fairness for four chronic-condition groups also improved fairness for nearly 90% of the other groups examined, even though those other groups were not directly included in the fairness objective.

The financial redistribution did not come from groups that were already undercompensated. Instead, it primarily reduced overcompensation among people without recorded health conditions.

For example:

  • Individuals with no recorded conditions were initially overcompensated by more than 2,200

  • Their overcompensation declined to approximately 800

  • Funds were redirected toward groups whose expected costs were previously underestimated

This suggests that fairness improvements can sometimes correct a broad imbalance rather than simply transferring resources from one disadvantaged group to another.


10. Ethical Machine Learning as a Full Pipeline

Ethical machine learning should be considered from the beginning of research through post-deployment monitoring.

An ethical pipeline includes:

  1. Problem selection

    • Which problem is being addressed?

    • Is it important?

    • Who benefits?

    • Who could be harmed?

  2. Funding and priority setting

    • Which communities receive research funding?

    • Are funding disparities shaping which problems are studied?

  3. Population definition

    • Who is included?

    • Who is excluded?

    • Does the sample represent the intended users and affected populations?

  4. Data collection

    • How were the measurements generated?

    • What biases are present?

    • Are some groups systematically missing?

  5. Outcome and predictor definition

    • Do the variables measure the intended concepts?

    • Are outcomes influenced by unequal access or documentation?

  6. Model development

    • Which statistical method is appropriate?

    • Are fairness constraints needed?

    • Are subgroup differences examined?

  7. Validation

    • Has the algorithm been externally validated?

    • Does it generalize across time, geography, institutions, and patient groups?

  8. Deployment

    • How will the algorithm be integrated into practice?

    • What decisions will it influence?

    • What safeguards are in place?

  9. Monitoring

    • Does performance change after deployment?

    • Are some groups harmed?

    • Has the data-generating process shifted?

  10. Accountability

    • Who is responsible when the algorithm causes harm?

    • Can users challenge or correct an algorithmic decision?

    • Can independent parties audit the system?

Ethics is therefore not a final checklist. It is a continuous part of the entire research and implementation process.


11. Causal Inference, Policy, and Practice

Complex machine learning methods are not automatically necessary for every research question. They can be difficult to:

  • Develop

  • Apply correctly

  • Explain to stakeholders

  • Validate

  • Translate into policy

The additional complexity is justified when it provides meaningful gains in robustness, validity, or discovery.

A central question is:

When does a more complex causal inference method produce information that simpler methods would miss?

An example involving medical devices illustrates why the answer can sometimes be important.


12. Medical Devices and Post-Market Evidence

Medical devices can have serious consequences, including severe complications and death. Unlike prescription drugs, the United States does not have an equally comprehensive national system that routinely distinguishes individual medical devices in healthcare data.

12.1 Challenges in studying devices

Important limitations include:

  • Individual devices are not routinely identified in medical claims

  • Devices are often studied in small pre-market trials

  • Devices change over time

  • New versions may differ substantially from earlier versions

  • Post-market safety information may be incomplete

  • Rare but severe harms may not appear in small trials

Pre-market evaluation is necessary but insufficient. Post-market surveillance is essential because real-world use exposes devices to:

  • Larger populations

  • More diverse patients

  • Different clinicians and hospitals

  • Longer follow-up

  • More complex comorbidities

  • Device-specific complications

12.2 Types of coronary stents

Two broad categories of cardiac stents are:

Bare-metal stents

  • Do not contain a drug coating

  • Provide mechanical support to keep the artery open

Drug-eluting stents

  • Are coated with a time-release drug

  • The drug is intended to inhibit cell proliferation

  • May reduce certain forms of restenosis

  • Include many distinct products with different designs

Studies often compare bare-metal stents with drug-eluting stents as broad categories. However, grouping all drug-eluting stents together may hide important differences among individual devices.

12.3 Heterogeneous safety outcomes among devices

A study of patients undergoing percutaneous coronary intervention examined whether different drug-eluting stents had different safety outcomes.

The devices showed substantial variation:

  • Some had safety outcome rates near 5%

  • Others had rates approaching 25%

A difference of this size is clinically important. A device associated with a roughly one-in-four chance of a safety outcome raises very different concerns from one associated with a rate near one-in-twenty.

The devices were anonymized by manufacturer and product identifier. A notable finding was that the best-performing and worst-performing devices came from the same manufacturer.

This demonstrates that manufacturer-level comparisons can conceal important product-level differences.

12.4 Why devices from one manufacturer may differ

Two stents from the same manufacturer may have very different safety profiles because they may differ in:

  • Approval date

  • Polymer composition

  • Drug formulation

  • Delivery system

  • Mechanical design

  • Manufacturing generation

  • Clinical indications

Two devices approved four years apart may represent substantially different technologies. Therefore, grouping them solely by manufacturer may be scientifically and biologically inappropriate.

12.5 Linking claims and registry data

The study combined:

  • Claims data

  • Clinical registry data

Claims data contributed information about healthcare utilization and outcomes. Registry data supplied deeper clinical detail about the coronary intervention cohort.

Combining data sources can improve analysis when each source provides complementary information. However, linkage quality and population representativeness remain essential considerations.

12.6 Double-robust machine learning

The heterogeneous effects among stents were identified only through a double-robust machine learning approach. Other methods failed to detect the signal.

Double-robust methods use flexible models for both:

  1. The outcome mechanism, describing how outcomes depend on treatment and covariates

  2. The treatment assignment mechanism, describing how treatment is assigned given covariates

If either one of these component models is correctly specified, the resulting estimator may remain consistent under appropriate conditions. Combining flexible machine learning with both mechanisms can provide robustness to model misspecification.

The conceptual structure is:

  • Estimate the probability of receiving each treatment given patient characteristics

  • Estimate expected outcomes under the relevant treatments

  • Combine these estimates in a way that corrects for confounding and improves robustness

The method’s ability to identify device-specific heterogeneous effects was reproduced in simulation studies, supporting the conclusion that the findings were not simply random artifacts.

12.7 Questions raised by post-market evidence

Device-specific safety findings create important questions for:

  • Patients

  • Hospitals

  • Manufacturers

  • Regulators

Relevant questions include:

  • How should device-specific evidence enter patient decision-making?

  • Should hospitals reconsider contracts with manufacturers?

  • Should poorly performing devices be removed from the market?

  • How should regulators respond to evidence unavailable at approval?

  • How should clinicians communicate uncertainty and comparative safety?

  • What level of evidence is sufficient for regulatory action?

12.8 Generalizability of device studies

The stent analysis was conducted in a clinical registry from Massachusetts. The results may not automatically transport to:

  • Other states

  • Other hospitals

  • Other patient populations

  • The entire United States

  • Different time periods

Differences in patient selection, clinical practice, device use, follow-up, and outcome recording could alter the observed effects.

Key principle: Discovering an important effect in one population does not establish that the effect is universal. External validation and transportability remain necessary.


13. Racism, Self-Critique, and Academic Responsibility

Health services research and health policy should explicitly examine how white supremacist ideologies and structural racism influence:

  • Research priorities

  • Study populations

  • Measurement systems

  • Clinical evidence

  • Health policy

  • Funding decisions

  • Algorithm design

  • Interpretation of results

A discipline should not assume that its methods are neutral simply because they are quantitative. The institutions that generate data, fund research, and define outcomes may reproduce historical inequities.

Researchers should engage in disciplinary self-critique, which includes:

  • Identifying whose perspectives are centered

  • Examining who is excluded

  • Questioning supposedly neutral categories

  • Studying the social origins of observed disparities

  • Recognizing how research may reinforce unequal systems

  • Revising methods and priorities when needed

Citation practices are also part of academic responsibility. Scholars should intentionally recognize and center the intellectual contributions of Black women and other groups whose work has historically been overlooked or undercited.


14. Questions Every Healthcare Algorithm Should Address

Before deployment, an algorithm should be evaluated through a set of accountability questions.

14.1 Social impact

  • Does the algorithm have a social impact statement?

  • Which individuals and communities are affected?

  • What benefits are expected?

  • What harms are plausible?

  • Could the algorithm reinforce existing disparities?

14.2 Responsibility

  • Who is responsible if users are harmed?

  • Is responsibility assigned to developers, institutions, clinicians, insurers, or regulators?

  • Can affected individuals appeal or challenge decisions?

  • Is there a process for correcting errors?

14.3 Explainability

  • Can users understand why a prediction was produced?

  • Can clinicians explain the result to patients?

  • Is the level of explanation appropriate for the decision’s consequences?

  • Does explainability include information about uncertainty and limitations?

14.4 Accuracy

  • How is accuracy defined?

  • Is the chosen metric appropriate for the clinical or policy task?

  • Is average accuracy hiding subgroup disparities?

  • Are calibration and error rates acceptable?

  • Does the algorithm perform well in external populations?

Accuracy is not a single universal concept. A model may be accurate in terms of discrimination but poorly calibrated, or accurate on average while producing unacceptable errors for a marginalized group.

14.5 Independent auditability

  • Can an independent third party evaluate the algorithm?

  • Can the model be audited if its code is proprietary?

  • Can the data-generating process be examined?

  • Are performance reports transparent?

  • Can subgroup performance be verified independently?

In healthcare, proprietary algorithms and restricted data can prevent meaningful scrutiny. Systems should be designed so that auditors without a financial stake in the tool can examine its validity, fairness, and safety.

Key principle: A healthcare algorithm should not be considered trustworthy if no independent party can evaluate whether it works and whom it harms.


15. Integrated Lessons

The central lessons across machine learning, healthcare data, fairness, and policy are interconnected.

  • Data quality often matters more than methodological novelty.

  • EHR, claims, registries, surveys, government data, wearables, digital traces, imaging, and news media measure different aspects of reality.

  • The data-generating process determines who appears in the dataset and what is recorded.

  • Internal validation is not enough for healthcare deployment.

  • Generalizability must be assessed for inference, prediction, clustering, and causal effects.

  • Dataset shift can occur even when the population appears unchanged.

  • Coding practices can be unstable and should not be treated as direct measures of disease.

  • Fairness begins with problem selection and continues through post-deployment monitoring.

  • Adding variables may worsen rather than reduce bias when variables encode structural inequality.

  • Financial prediction systems can create indirect incentives to discriminate.

  • Fairness-aware methods can substantially improve equity with relatively small losses in predictive performance.

  • Improving fairness for selected groups may also improve fairness for many other groups.

  • Medical devices require detailed product-level and post-market evaluation.

  • Double-robust machine learning can reveal heterogeneous treatment effects that simpler methods miss.

  • A result from one state, institution, or registry should not automatically be treated as nationally representative.

  • Researchers must examine racism, exclusion, and power within health services research and policy.

  • Algorithms require social impact statements, accountability, explainability, appropriate accuracy measures, and independent auditability.

Ultimately, responsible healthcare machine learning requires more than applying an algorithm to a large dataset. It requires understanding the clinical and social problem, choosing appropriate data, studying the target population, testing robustness, evaluating fairness, anticipating harms, and maintaining accountability after deployment.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent