# Leveraging text data for causal inference using electronic health records

arXiv: https://arxiv.org/abs/2307.03687 · HTML: https://mlsanity.com/paper/2307.03687/

## Key facts

- Cited by 6 papers in the map (data through 14 Oct 2026).
- Builds on 10 of its 77 references that are in the map.
- First posted on arXiv 9 Jun 2023.

## Builds on (most cited first, 10 of 10)

- [Publicly Available Clinical BERT Embeddings](https://mlsanity.com/paper/1904.03323/) (2019)
- [ClinicalBERT: Modeling Clinical Notes and Predicting Hospital Readmission](https://mlsanity.com/paper/1904.05342/) (2019)
- [Scalable and accurate deep learning for electronic health records](https://mlsanity.com/paper/1801.07860/) (2018)
- [How to Make Causal Inferences Using Texts](https://mlsanity.com/paper/1802.02163/) (2018)
- [Text and Causal Inference: A Review of Using Text to Remove Confounding from Causal Estimates](https://mlsanity.com/paper/2005.00649/) (2020)
- [Some methods for heterogeneous treatment effect estimation in high-dimensions](https://mlsanity.com/paper/1707.00102/) (2017)
- [Matching with Text Data: An Experimental Evaluation of Methods for Matching Documents and of Measuring Match Quality](https://mlsanity.com/paper/1801.00644/) (2018)
- [A stacked approach for chained equations multiple imputation incorporating the substantive model](https://mlsanity.com/paper/1910.04625/) (2019)
- [A comparison of strategies for selecting auxiliary variables for multiple imputation](https://mlsanity.com/paper/2203.16717/) (2022)
- [Insights on Variance Estimation for Blocked and Matched Pairs Designs](https://mlsanity.com/paper/1710.10342/) (2017)

## Built on by (most cited first, 6 of 6)

- [Causal Inference with Generative Artificial Intelligence: Application to Texts as Treatments](https://mlsanity.com/paper/2410.00903/) (2024)
- [A Design-based Solution for Causal Inference with Text: Can a Language Model Be Too Large?](https://mlsanity.com/paper/2510.08758/) (2025)
- [LLM-Extracted Covariates for Clinical Causal Inference: Rethinking Integration Strategies](https://mlsanity.com/paper/2604.16763/) (2026)
- [Causal Inference with Unstructured Treatments](https://mlsanity.com/paper/2608.00657/) (2026)
- [The Confounder Trap: Treatment-Encoding Representations in Causal Inference with Text](https://mlsanity.com/paper/2607.26309/) (2026)
- [Information Set Emulation: Causal Certificates for AI Derived EHR Features](https://mlsanity.com/paper/2609.17777/) (2026)

## Abstract (arXiv)

In studies that rely on data from electronic health records (EHRs), unstructured text data such as clinical progress notes offer a rich source of information about patient characteristics and care that may be missing from structured data. Despite the prevalence of text in clinical research, these data are often ignored for the purposes of quantitative analysis due their complexity. This paper presents a unified framework for leveraging text data to support causal inference with electronic health data at multiple stages of analysis. In particular, we consider how natural language processing and statistical text analysis can be combined with standard inferential techniques to address common challenges due to missing data, confounding bias, and treatment effect heterogeneity. Through an application to a recent EHR study investigating the effects of a non-randomized medical intervention on patient outcomes, we show how incorporating text data in a traditional matching analysis can help strengthen the validity of an estimated treatment effect and identify patient subgroups that may benefit most from treatment. We believe these methods have the potential to expand the scope of secondary analysis of clinical data to domains where structured EHR data is limited, such as in developing countries. To this end, we provide code and open-source replication materials to encourage adoption and broader exploration of these techniques in clinical research.
