How to Make Causal Inferences Using Texts

Naoki Egami, Christian J. Fong, Justin Grimmer, Margaret E. Roberts, Brandon M. StewartarXiv 2018

In the era of "text as data," social scientists have a powerful new toolkit for exploring human behavior. However, using high-dimensional text to prove cause-and-effect relationships is a statistical minefield. A new paper by Naoki Egami and colleagues provides a rigorous roadmap for navigating these challenges using a simple yet powerful technique: the train/test split.

Abstract

New text as data techniques offer a great promise: the ability to inductively discover measures that are useful for testing social science theories of interest from large collections of text. We introduce a conceptual framework for making causal inferences with discovered measures as a treatment or outcome. Our framework enables researchers to discover high-dimensional textual interventions and estimate the ways that observed treatments affect text-based outcomes. We argue that nearly all text-based causal inferences depend upon a latent representation of the text and we provide a framework to learn the latent representation. But estimating this latent representation, we show, creates new risks: we may introduce an identification problem or overfit. To address these risks we describe a split-sample framework and apply it to estimate causal effects from an experiment on immigration attitudes and a study on bureaucratic response. Our work provides a rigorous foundation for text-based causal inferences.

The Challenge of Text-Based Causal Inference

Text is inherently high-dimensional and messy. To use it in social science, we must compress it into a low-dimensional "codebook" (which the authors call the function $g$), such as topics, sentiment scores, or categories.

The problem arises because researchers rarely know $g$ in advance; they usually "discover" it by looking at the data (e.g., running a topic model). If you use the same documents to discover your categories and then estimate the causal effect of those categories, you run into two major issues:

  1. Analyst-Induced SUTVA Violation (AISV): In causal inference, the Stable Unit Treatment Value Assumption (SUTVA) posits that one unit's treatment doesn't affect another's outcome. However, if the definition of a category (e.g., "Topic A") depends on the treatment assignments of every unit in your sample, you have manually induced a dependence across the entire dataset.
  2. Overfitting: With thousands of ways to slice text data, it is dangerously easy to "fish" for a version of $g$ that yields a statistically significant result, even if it is merely noise.

The Split-Sample Framework

To address these risks, the authors propose a Split-Sample Framework to decouple discovery from estimation. This procedure ensures that the definition of the variables is fixed before any causal effects are estimated.

The proposed split-sample framework for decoupling discovery from estimation.

The framework proceeds in two primary stages:

  1. The Training Set: Use a portion of the data (e.g., 50%) to discover the codebook function $g$. Here, the analyst can iterate, run unsupervised models like the Structural Topic Model (STM), label topics, and validate that the categories make theoretical sense.
  2. The Test Set: Once $g$ is finalized and "locked," it is applied to the remaining data. This set is used exactly once to estimate the causal effect (e.g., the Average Treatment Effect).

By fixing the definition of the variables in the training set before looking at the test set, the researcher eliminates AISV and provides a natural safeguard against p-hacking.

Empirical Applications

The paper demonstrates the framework through two distinct applications:

Immigration Experiment

A survey experiment (based on Cohen et al., 2004) where respondents were told about an immigrant's criminal history (treatment) and asked to provide open-ended reasons for their punishment preferences (text as outcome). The authors ran three iterations of this experiment (totaling ~3,300 respondents) to show how $g$ evolves and replicates. The criminal history treatment significantly shifted the content of respondent justifications. Treated individuals were much more likely to write about "maximal punishment" and "deportation," while the control group focused on "rehabilitation" or "circumstances of the crime."

CFPB Complaints

A massive dataset of 113,424 consumer complaints from the Consumer Financial Protection Bureau. Here, text is the treatment: the authors used a Supervised Indian Buffet Process (sIBP) to discover which features of a written complaint (e.g., "detailed feedback" vs. "threats") cause a company to provide a timely response. They found that providing "detailed feedback" significantly increased the probability of a prompt response, whereas "threats" decreased it. Simulations also showed that while topic models can be unstable across different splits, using "warm starts" (initializing models with prior information) can significantly improve the consistency of the discovered measures.

Key Insights

  • The "Discovery" Trap: Discovery is central to text analysis but fatal to traditional causal inference if not handled separately.
  • Category Stability: In text, categories are emergent. If you re-randomized your experiment, an unsupervised model might give you entirely different topics, making it impossible to define a stable estimand without a split-sample approach.
  • Human-in-the-Loop: Unlike pure machine learning, social science requires interpretable labels. The split-sample approach allows the human analyst to "get their hands dirty" in the training set without corrupting the final statistical test.

Limitations and Future Work

While powerful, the framework has limitations. The most obvious is the efficiency loss from splitting the sample, which effectively reduces the power for the final estimation. For very large datasets, one might only need a small fraction for training. Additionally, current implementations treat the discovered $g$ as a fixed, "true" measure in the test set; future work could better integrate the measurement error of the latent variable into the final causal variance.

Summary updated

BibTeX
@misc{egami2018how,
  author = {Naoki Egami and Christian J. Fong and Justin Grimmer and Margaret E. Roberts and Brandon M. Stewart},
  title = {{How to Make Causal Inferences Using Texts}},
  year = {2018},
  eprint = {1802.02163},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1802.02163},
}
Figure