Skip to main content
QUICK REVIEW

[论文解读] CausalGPS: An R Package for Causal Inference With Continuous Exposures

Naeem Khoshnevis, Xiao Wu|arXiv (Cornell University)|Oct 1, 2023
Advanced Causal Inference TechniquesMathematics被引用 3
一句话总结

CausalGPS 是一个 R 包,通过加权或匹配方法使用广义倾向得分(GPS)实现连续暴露的因果推断。它自动化了 GPS 估计、通过迭代变换实现协变量平衡优化以及结果建模,在真实世界数据中实现了更优的平衡和高效估计,如在 PM2.5 暴露分析中通过最优卡钳选择和修剪策略所展示的那样。

ABSTRACT

Quantifying the causal effects of continuous exposures on outcomes of interest is critical for social, economic, health, and medical research. However, most existing software packages focus on binary exposures. We develop the CausalGPS R package that implements a collection of algorithms to provide algorithmic solutions for causal inference with continuous exposures. CausalGPS implements a causal inference workflow, with algorithms based on generalized propensity scores (GPS) as the core, extending propensity scores (the probability of a unit being exposed given pre-exposure covariates) from binary to continuous exposures. As the first step, the package implements efficient and flexible estimations of the GPS, allowing multiple user-specified modeling options. As the second step, the package provides two ways to adjust for confounding: weighting and matching, generating weighted and matched data sets, respectively. Lastly, the package provides built-in functions to fit flexible parametric, semi-parametric, or non-parametric regression models on the weighted or matched data to estimate the exposure-response function relating the outcome with the exposures. The computationally intensive tasks are implemented in C++, and efficient shared-memory parallelization is achieved by OpenMP API. This paper outlines the main components of the CausalGPS R package and demonstrates its application to assess the effect of long-term exposure to PM2.5 on educational attainment using zip code-level data from the contiguous United States from 2000-2016.

研究动机与目标

  • 解决在传统方法因缺乏重叠或不平衡而失效的观察性研究中,连续暴露的因果推断挑战。
  • 开发一个模块化、高效且可靠的 R 包,支持 GPS 估计、伪总体生成和结果建模,并可自定义调参。
  • 自动化最优超参数和协变量变换的选择,以实现可接受的协变量平衡。
  • 为用户提供灵活的工具,用于修剪暴露和 GPS 支持范围、超参数调优以及迭代平衡改进。

提出的方法

  • 该包使用用户定义的超参数的集成机器学习模型(如 XGBoost)估计 GPS,并支持参数化、半参数化和非参数化结果建模。
  • 它实现了一种新颖的迭代协变量变换策略,每一步对最不平衡的协变量应用用户定义的单变量函数(如平方、立方)以改善 GPS 估计。
  • 通过暴露与协变量之间的绝对相关性评估协变量平衡;当平衡阈值(如 0.1)满足或达到最大迭代次数时,过程停止。
  • 用户可对暴露(exposure_trim_qtls)和 GPS 值(gps_trim_qtls)应用修剪,以改善正性并确保支持重叠。
  • 该包支持两种因果推断方法:逆概率加权和匹配,其中匹配使用 L1 距离和基于卡钳的邻居选择。
  • 它包含日志记录系统、性能优化的 C++ 后端,以及全面的单元测试和功能测试,以确保可靠性和可扩展性。

实验结果

研究问题

  • RQ1在具有高维混杂因素的观察性数据中,如何有效估计并优化连续暴露的广义倾向得分?
  • RQ2在基于匹配的因果推断中,暴露和 GPS 修剪对协变量平衡和估计效率有何影响?
  • RQ3迭代协变量变换能否在无需事先知晓最优变换形式的情况下改善 GPS 估计并实现可接受的平衡?
  • RQ4不同的超参数配置和模型库如何影响 GPS 估计及最终的因果效应估计?
  • RQ5在不同修剪范围和超参数设置下,迭代平衡优化的计算成本与性能权衡如何?

主要发现

  • 将暴露数据修剪至第 10 和第 90 百分位数时,实现了最佳平衡(最大绝对相关性为 0.094),仅需 3 次迭代和 287.32 秒,优于更宽的修剪范围。
  • 最优卡钳大小(delta_n)随修剪范围变化:第 1–99 百分位数为 1.7,第 5–95 百分位数为 0.9,第 10–90 百分位数为 1.9,表明其对支持定义敏感。
  • 迭代协变量变换方法成功减少了不平衡,在修剪至第 10–90 百分位数时,经过 3 次迭代达到最佳平衡。
  • 通过 gps_trim_qtls 排除极端 GPS 值可改善匹配质量,但改变了目标因果 estimand,凸显了对因果 estimand 进行谨慎解释的必要性。
  • 该包在最多 10 次迭代内实现了可靠性能,且时间成本随修剪范围扩大和超参数搜索空间增加而显著上升。
  • generate_pseudo_pop() 输出的 S3 对象包含完整元数据,包括原始和调整后的相关性、最优超参数以及匹配后的伪总体,确保了完全可重现性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。