Biostatistics and Health Data Science


Biostatistics and Health Data Science

Corey
Welcome back. Today we're discussing machine learning in healthcare, with a central message: healthcare data is too important to treat as a toy problem. The reason is simple but profound—behind every data point is a person, a family, and potentially suffering. So statistical and machine learning methods have to be developed with real human consequences in mind.

Simon
And that means the goal is not just to build a technically impressive model. The model has to be useful, computationally feasible, translatable into practice, and attentive to the possibility of perpetuating harm, especially for marginalized groups.

Corey
Exactly. A useful way to think about statistical machine learning is that data and substantive knowledge enter the system as inputs. We also need clearly specified benchmarks and methodological theory underneath the model, but enough flexibility to handle messy real-world data. A method that is theoretically optimal yet impossible to compute or apply is not going to solve a practical healthcare problem.

Simon
That connects to the idea that learning two fields takes surprisingly much longer than learning one, but the investment is worthwhile because it lets you solve real problems. Someone trained in statistics should learn the healthcare application deeply, and someone clinically trained should understand the machine learning method deeply rather than simply using an algorithm off the shelf.

Corey
Right. In genetics and genomics, statisticians have often invested deeply in the scientific problems. Healthcare needs more of that same engagement. Asking only, 'What are the Xs and Ys, and can I apply my tool?' is not enough. The research team needs to understand what the healthcare question actually means and how the result could affect policy or patient care.

Simon
And the people doing the research should reflect the society being served. Homogeneous teams can overlook important parts of the research pipeline: the question itself, who belongs in the target population, which outcomes matter, and how a tool should be evaluated.

Corey
That is why diversity and genuine team science matter. It is not sufficient to approach a clinician or health system by saying, 'Can I have your data?' The researchers and applied experts should develop the question and the algorithm together so the final tool is actually useful in practice.

Simon
Before discussing algorithms, we need to discuss the data. Electronic health information is increasingly available, but its usefulness varies by the specific scientific question. Sometimes the data source is simply not suitable, and in many real problems, data quality and inherent bias matter more than developing a new statistical method.

Corey
A crucial warning is that EHR does not equal EHR. The phrase 'electronic health record data' can refer to several very different sources. Clinical records contain clinical information, but systems are often not integrated across healthcare organizations. Billing claims can have enormous sample sizes, yet they are collected for billing rather than to be clinically informative, so important clinical details may be missing.

Simon
Clinical registries are another category. They often contain detailed, disease-specific information, which can be extremely useful, but they may only follow people for short-term outcomes. Sometimes researchers can link registries to vital statistics to obtain longer-term outcomes.

Corey
Survey data can be tailored to a particular research question, but surveys usually have smaller sample sizes and can suffer from recall bias. Government data may offer unique information not found elsewhere, although it is often available only at an aggregated level, such as the ZIP-code level. Researchers also have to examine the societal biases built into those data—for example, crime statistics can reflect bias in how crime is reported and recorded.

Simon
Newer sources include wearable and implantable technology, digital data, and news media data. Wearables can provide granular measurements of activity without relying on memory, but they introduce measurement problems: an accelerometer might measure steps well while measuring distance poorly. Researchers must also ask who has access to a Fitbit or similar device, because that affects the population represented.

Corey
Digital data, such as search or Twitter data, can be noisy, so skepticism is appropriate. But we should not reject newer sources automatically, because they may provide information unavailable in traditional healthcare data, particularly in places without high-quality healthcare. News media data is especially important for outbreak detection because it can be more timely than sources with long delays.

Simon
There is also an important issue of who appears in healthcare data at all. To appear in billing claims or a clinical record, a person generally has to have an encounter with the healthcare system. People without such encounters may be absent from those sources but still appear in digital data.

Corey
And the categories overlap. Imaging, such as MRI data, may be integrated into a clinical record but could also be considered digital data. The key lesson is to understand exactly how a source was created, what it measures, whom it includes, and which biases or errors it carries.

Simon
This is particularly important with billing claims and causal inference. Claims can answer some very specific questions, but they are often unreliable for causal questions because the data were not collected for that purpose and may lack the clinical detail needed to support the analysis.

Corey
The next major idea is generalizability. It applies not only to inference, such as transporting an effect from a randomized trial or observational study to a target population, but also to prediction and clustering. For example, an effect estimated among Medicaid enrollees in New York may not automatically apply to a very different Medicaid population in Texas.

Simon
Prediction research often has weak generalizability evidence. A team may use one year of data from one center, build a model for a binary health outcome, evaluate it with limited metrics, and report a single AUC as though it were a complete assessment.

Corey
That is the so-called AUC leaderboard problem: ranking models by one global metric can hide serious failures in the data or in particular groups. Stronger work should include external samples, not just internal cross-validation, and should explicitly evaluate whether the algorithm generalizes. A model that is at most a pilot study should not be presented as ready for deployment everywhere.

Simon
Another challenge is dataset shift—the inputs may change between model development and deployment. Billing data can shift even when the underlying population has not, because coding practices are unreliable.

Corey
For example, chronic conditions are not coded with equal persistence from one year to the next. Type 1 diabetes may be coded relatively consistently, partly because many patients have regular healthcare encounters. But among people coded with paraplegia in one year, fewer than 60 percent were coded with paraplegia the following year. Missing a code does not necessarily mean the person no longer has the condition, and having a code does not guarantee that the condition is truly present.

Simon
Those problems become even more complicated when people have multiple chronic conditions, especially older adults. So an algorithm trained on claims data needs to account for changing documentation and misclassification, not treat codes as perfect measurements of health.

Corey
A concrete example is health plan risk adjustment. This is a prediction problem used to redistribute funds based on health, encouraging insurers to compete on efficiency and quality rather than avoid expensive enrollees. The model predicts spending from variables such as documented sex, age categories, and numerous binary indicators for health conditions, often derived from billing claims.

Simon
Because risk adjustment affects payments for millions of people, it has enormous social and financial consequences. If an enrollee has a coded condition with a positive weight, that can increase the payment to the insurer. This creates incentives to record as many conditions as possible, a practice known as upcoding, which can be legal or illegal.

Corey
One study explored whether reducing the number of risk-adjustment variables could reduce incentives for upcoding. In a commercially insured population, a data-adaptive machine learning approach using only ten variables was 92 percent as efficient as the larger formula. But that result did not generalize to Medicare.

Simon
And the failure was broader than simply saying the original ten variables were wrong for Medicare. Even rebuilding the subset-selection process specifically with Medicare data performed consistently worse across the benchmarks. That is a powerful reminder that both formulas and procedures may fail to generalize, especially when the target population—such as older adults or people with disabilities—is different from the development population.

Corey
There was also an example of prediction using the wrong data. Commercially insured data were used to build formulas for marketplace plans, even though people with employer insurance are not eligible for those marketplaces. Traditional Medicare data were also used for Medicare Advantage, although Medicare Advantage is a managed-care population.

Simon
Interestingly, in those two empirical cases, matched samples designed to resemble the actual target populations produced results very similar to the original analyses. So using the wrong data did not appear to be a problem in those settings. But that is only two pieces of evidence, and it may not remain true as populations change—for example, Medicare Advantage includes growing numbers of medically complex individuals.

Corey
That brings us to fairness, which spans inference, clustering, and prediction. Questions include: Who chose the research question? Who is in the target population? What do the data reflect? And how will the algorithm be assessed? Healthcare data can reflect structural racism, unequal access, and disadvantages affecting rural and lower-socioeconomic-status communities.

Simon
Performance can differ sharply across groups. The Gender Shades work showed substantially worse facial-recognition classification accuracy for women, particularly women with darker skin tones. Healthcare studies have a related problem: people may be excluded from the research in the first place.

Corey
A ProPublica analysis found that Black people and Native Americans were underrepresented in cancer clinical trials, even when the cancers disproportionately affected those groups. Older adults are another example. One study found that older adults could be excluded from more than 20 percent of COVID-19 clinical trials and all vaccine trials, despite representing 9 percent of the U.S. population, around 30 to 40 percent of cases, and at least 80 percent of deaths.

Simon
So fairness has to be considered across the entire pipeline, not just after a model is built. The stages can be described as pre-processing, fitting, and post-processing. Pre-processing may transform data to reduce societal bias; fitting may use additional variables, separate formulas for groups, or fairness-aware statistical learning; and post-processing may use different classification thresholds for different groups.

Corey
Adding variables is not automatically a fairness solution. It can create a feedback loop that builds existing bias back into the algorithm. In formal terms, we might predict an outcome Y from inputs X, with a protected or sensitive attribute A included among those inputs, while trying to make the prediction function fair across groups.

Simon
Many fairness measures use group fairness: predicted outcomes or errors should be similar across groups. In risk adjustment, one relevant measure is net compensation, calculated as predicted spending minus observed spending. If the average is negative for a group, insurers are undercompensated for that group and may have an incentive to avoid covering its members.

Corey
Mental health and substance use disorders show why this matters. Mental health conditions are number one in total healthcare costs and number two in spending growth, while about one in five people have a mental health condition. Yet one marketplace risk-adjustment study found that the formula recognized only 20 percent of enrollees with mental health and substance use disorders.

Simon
That under-recognition can systematically disadvantage those enrollees. Insurers may respond through benefit designs that make drugs more expensive, provider networks that are less attractive or accessible, or other choices that make people with those conditions less likely to enroll.

Corey
One response is to build fairness directly into the model. Constraint-and-penalize regression methods add fairness constraints to the loss function. In the example discussed, fairness-aware methods had R-squared values close to standard ordinary least squares, with only about a 4 percent drop, but they reduced undercompensation for the affected group from nearly $2,000 to about $46.

Simon
That nearly $1,872 reduction was substantial—it represented about 16 percent of mean spending. Later work combined variable selection, fairness metrics, and post-processing. Improving fairness for four chronic-condition groups also improved fairness for nearly 90 percent of other groups examined.

Corey
Importantly, the improvement did not come from taking money away from groups that were already undercompensated. It mainly reduced overcompensation among people with no recorded health conditions—from more than $2,200 to roughly $800. That is a useful example of how methodological work can lead to concrete policy recommendations when it is communicated to the right policymakers.

Simon
The ethical pipeline therefore begins before model fitting, with problem selection and decisions about funding, and continues through deployment. It asks who benefits, who may be harmed, who is missing from the data, and what happens after implementation.

Corey
The talk's final technical example concerns medical devices and causal inference. Medical devices can have severe side effects, including death, but unlike prescription drugs, there is not the same national system routinely identifying individual devices in medical claims. Devices are often studied in small pre-market trials, change over time, and require important post-market evaluation.

Simon
Researchers examined heterogeneous effects among cardiac stents used in percutaneous coronary intervention. Bare-metal stents do not have a drug coating, while drug-eluting stents release a drug over time to inhibit cell proliferation. Rather than comparing only the two broad categories, the researchers studied different individual drug-eluting stents.

Corey
The safety outcomes differed dramatically: some stents had rates near 5 percent, while others approached 25 percent. Even stents made by the same manufacturer could perform very differently. Two examples had been approved four years apart and differed in their polymers and delivery systems, so grouping devices by manufacturer would have hidden important scientific and biological differences.

Simon
This analysis combined claims data with registry data, bringing together large-scale information and deeper clinical detail. Double-robust machine learning was the only method among those compared that detected the heterogeneous treatment effects, and a simulation study reproduced the result.

Corey
The advantage came from using flexible machine learning for both the outcome mechanism and the treatment-assignment mechanism. That additional robustness helped uncover a signal that other approaches missed. But generalizability still matters: the study used a Massachusetts clinical registry, so there is no guarantee the results transport to other states or to the entire United States.

Simon
And the findings raise practical questions. How should patients use this information? Should hospitals reconsider contracts with manufacturers? Should manufacturers remove poorer-performing stents? How should regulators respond to post-market evidence that was unavailable when a device was approved?

Corey
Those questions illustrate why healthcare machine learning cannot stop at prediction accuracy. We also need to examine racism and other structural forces in health services research, including who receives funding, who is represented in studies, and whose intellectual contributions are recognized.

Simon
A responsible algorithm should come with a social impact statement. We should ask who is responsible if users are harmed, whether the tool is explainable, how accuracy is defined, and whether an independent third party can audit it.

Corey
Independent auditing is especially important when the algorithm is proprietary or the data cannot be shared. Healthcare systems should be designed so that someone without a stake in the tool can evaluate it. And fairness improvements should be checked across groups, so that helping one marginalized group does not unintentionally harm another.

Simon
So the overall lesson is not to reject machine learning in healthcare. It is to practice it with deeper subject-matter engagement, careful attention to data provenance and bias, external validation, generalizability analysis, fairness assessment, and responsibility after deployment.

Corey
Exactly. Statistical innovation matters, but it has to remain connected to the people represented by the data and the policies shaped by the results. If we remember that every observation is part of a human story, then machine learning can become a tool for improving health rather than reproducing the inequalities already present in healthcare.

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