NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

SpaCE: The Spatial Confounding Environment

Mauricio Tec, Ana Trisovic, Michelle Audirac, Sophie Woodward, Jie Kate Hu, Naeem Khoshnevis, Francesca Dominici

Abstract

Spatial confounding poses a significant challenge in scientific studies involving spatial data, where unobserved spatial variables can influence both treatment and outcome, possibly leading to spurious associations. To address this problem, we introduce SpaCE: The Spatial Confounding Environment, the first toolkit to provide realistic benchmark datasets and tools for systematically evaluating causal inference methods designed to alleviate spatial confounding. Each dataset includes training data, true counterfactuals, a spatial graph with coordinates, and smoothness and confounding scores characterizing the effect of a missing spatial confounder. It also includes realistic semi-synthetic outcomes and counterfactuals, generated using state-of-the-art machine learning ensembles, following best practices for causal inference benchmarks. The datasets cover real treatment and covariates from diverse domains, including climate, health and social sciences. SpaCE facilitates an automated end-to-end pipeline, simplifying data loading, experimental setup, and evaluating machine learning and causal inference models.

Introduction

In fields ranging from epidemiology to climate science, researchers frequently attempt to determine if a specific "treatment" (such as air pollution levels) causes a particular "outcome" (such as hospitalization rates). However, these efforts are often hindered by spatial confounding. This phenomenon occurs when an unobserved variable—such as urbanization or local topography—varies across a geographic area and simultaneously influences both the treatment and the outcome.

Without accounting for these hidden patterns, models may mistake spatial correlation for a causal link, leading to "spurious associations." The fundamental challenge is that real-world data lacks "counterfactuals"—we cannot observe what would have happened to a specific location under a different treatment level. SpaCE (The Spatial Confounding Environment) addresses this by providing the first comprehensive toolkit and benchmark suite designed to rigorously test how well causal inference models handle these hidden spatial biases.

The SpaCE Framework

SpaCE provides a standardized environment for evaluating causal models across a wide variety of scenarios. It categorizes datasets based on several critical dimensions that affect model performance, including treatment type, spatial format, and the nature of the missing confounder.

Overview of the SpaCE environment parameters, including treatment types, spatial formats, and causal estimands.

The toolkit introduces 6 DataCollections covering diverse domains, which are used to generate 124 unique SpaceDatasets. These include:

  • Social Vulnerability and Welfare: Census tract data from Texas.
  • Heat Exposure and Wildfires: Climate data from California.
  • Air Pollution and Mortality: Nationwide US county data.
  • Welfare and Elections: US county-level socioeconomic and voting data.
  • PM2.5 Components: High-resolution (1km x 1km) satellite-derived data.
  • Socioeconomic Status and Broadband: Zip-code level usage data.

Methods: Creating Realistic Benchmarks

To create benchmarks that are both realistic and verifiable, the authors developed a sophisticated semi-synthetic pipeline. They begin with real-world covariates and treatments but generate outcomes using AutoGluon, an ensemble of high-performance machine learning models. This ensures the relationships between variables are complex and non-linear, rather than simple linear approximations.

The SpaCE pipeline generates semi-synthetic outcomes and counterfactuals while preserving the spatial characteristics of the original data.

Key technical innovations in the pipeline include:

  • Spatial Residual Modeling: To ensure unexplained variations behave like real spatial data, the authors use Gaussian Markov Random Fields (GMRF), ensuring nearby locations share similar noise characteristics.
  • Controlled Masking: Certain spatial variables are intentionally "hidden" from the models. SpaCE then provides "smoothness" and "confounding" scores to quantify the difficulty of recovering the true effect.
  • Spatially-Aware Validation: Standard random data splits often lead to "extreme overfitting" in spatial contexts because nearby points are too similar. SpaCE uses a Breadth-First Search (BFS) approach to create spatially separated training and validation sets, preventing data leakage.

Key Insights and Results

The authors benchmarked several state-of-the-art models, including Graph Convolutional Neural Networks (GCNN) and spatial spline models (SPATIAL+). Their findings highlight the difficulty of the spatial confounding problem:

  1. Model Performance: For binary treatments, the SPATIAL+ algorithm generally excelled at estimating the Average Treatment Effect (ATE). For continuous treatments, GMERROR (a spatial error model) often performed best, though no single model dominated across all datasets.
  2. The Overfitting Trap: Causal models that appear highly accurate on random test sets often fail when applied to new geographic areas. This underscores the necessity of the BFS-based spatial validation provided by SpaCE.
  3. GCNN Limitations: Despite their popularity, Graph Neural Networks were found to be highly sensitive to hyperparameters and often struggled with overfitting, sometimes resulting in larger errors than simpler linear baselines like Ordinary Least Squares (OLS).
  4. Confounder Smoothness: The "smoother" a hidden confounder is (varying gradually over space), the easier it is for models like Distance-Adjusted Propensity Score Matching (DAPSM) to account for its effects.

Limitations and Future Work

While SpaCE represents a major step forward, the authors identify several areas for future development. The current framework relies on an Additive Noise Model (ANM), which may not capture cases where noise interacts non-linearly with treatment. Furthermore, the current datasets do not account for interference or spillover effects, where a treatment in one location affects the outcome in a neighboring location. Finally, expanding the environment from static "snapshots" to spatio-temporal data remains a key goal for future iterations.

Summary updated

BibTeX
@inproceedings{tec2024space,
  author = {Mauricio Tec and Ana Trisovic and Michelle Audirac and Sophie Woodward and Jie Kate Hu and Naeem Khoshnevis and Francesca Dominici},
  title = {{SpaCE: The Spatial Confounding Environment}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=D9rJdtmIG6},
}
Figure