Inverse Probability of Treatment Weighting with Deep Sequence Models Enables Accurate treatment effect Estimation from Electronic Health Records

Junghwan Lee, Simin Ma, Nicoleta Serban, Shihao YangarXiv 2024

Abstract

Observational data have been actively used to estimate treatment effect, driven by the growing availability of electronic health records (EHRs). However, EHRs typically consist of longitudinal records, often introducing time-dependent confoundings that hinder the unbiased estimation of treatment effect. Inverse probability of treatment weighting (IPTW) is a widely used propensity score method since it provides unbiased treatment effect estimation and its derivation is straightforward. In this study, we aim to utilize IPTW to estimate treatment effect in the presence of time-dependent confounding using claims records. Previous studies have utilized propensity score methods with features derived from claims records through feature processing, which generally requires domain knowledge and additional resources to extract information to accurately estimate propensity scores. Deep sequence models, particularly recurrent neural networks and self-attention-based architectures, have demonstrated good performance in modeling EHRs for various downstream tasks. We propose that these deep sequence models can provide accurate IPTW estimation of treatment effect by directly estimating the propensity scores from claims records without the need for feature processing. We empirically demonstrate this by conducting comprehensive evaluations using synthetic and semi-synthetic datasets.

Introduction

In medical research, Randomized Controlled Trials (RCTs) are the gold standard for estimating treatment effects. However, their high cost and ethical constraints often necessitate the use of observational data, such as Electronic Health Records (EHRs) and insurance claims. The primary challenge in using observational data is confounding—variables that influence both treatment assignment and outcomes.

A particularly difficult form is time-dependent confounding, where the timing and order of medical events influence clinical decisions and outcomes. Traditional statistical methods, like Logistic Regression, often aggregate patient histories into "bag-of-codes" representations, discarding the temporal context necessary to identify these confounders.

Causal diagrams illustrating (a) general confounding and (b) time-dependent confounding where the distance between events matters.

Methods

The researchers employed Inverse Probability of Treatment Weighting (IPTW) to address confounding. IPTW uses a "propensity score"—the probability of a patient receiving a treatment given their history—to weight observations and create a balanced synthetic population.

The study's core innovation lies in using deep sequence models to estimate these propensity scores directly from raw longitudinal data:

  • LSTM (Long Short-Term Memory): A recurrent neural network capable of capturing long-term dependencies in sequences.
  • BERT (Bidirectional Encoder Representations from Transformers): Two variants were tested: $BERT_{code}$ (modeling individual medical codes) and $BERT_{record}$ (modeling entire clinical visits).

These models were compared against traditional baselines: Logistic Regression (LR) and Multi-Layer Perceptrons (MLP), including versions enhanced with High-Dimensional Propensity Score (HDPS) feature selection.

Architectures of the deep sequence models used for propensity score estimation: (a) LSTM, (b) BERT_code, and (c) BERT_record.

Experimental Setup

The models were evaluated on two types of data:

  1. Synthetic Datasets: 12,000 records designed with three confounding scenarios: Consecutive Occurrence, Occurrence Distance, and Occurrence Window.
  2. Semi-synthetic Dataset (Synthea): Simulated EHR data modeling a "viral sinusitis" vs. "chronic sinusitis" scenario to mimic realistic, time-sensitive confounding.

Results and Discussion

Deep sequence models significantly outperformed traditional baselines across all scenarios.

Temporal Context and Accuracy

Traditional methods (LR and MLP) struggled with confounding that depended on the distance or order of events. In contrast, LSTM and BERT models, which process histories as sequences, naturally captured these temporal patterns. For example, in the "Occurrence Window" task, the LSTM reduced the Propensity Score Mean Absolute Error (MAE) to 0.070, compared to 0.314 for Logistic Regression.

Automation and Interpretability

The deep learning approach eliminates the need for manual feature engineering (like HDPS), which requires extensive domain expertise. Furthermore, BERT's attention mechanisms provided clinical interpretability by assigning higher weights to the actual confounding variables, confirming that the model identified relevant clinical signals rather than spurious correlations.

Conclusion

This study demonstrates that deep sequence models can accurately estimate treatment effects from complex longitudinal EHR data by effectively handling time-dependent confounding. While current models focus on binary treatments and static outcomes, future work will explore multi-treatment scenarios and evolving treatment effects over time. These findings suggest a path toward more automated and reliable causal inference in healthcare.

Summary updated

BibTeX
@misc{lee2024inverse,
  author = {Junghwan Lee and Simin Ma and Nicoleta Serban and Shihao Yang},
  title = {{Inverse Probability of Treatment Weighting with Deep Sequence Models Enables Accurate treatment effect Estimation from Electronic Health Records}},
  year = {2024},
  eprint = {2406.08851},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.08851},
}
Figure