arXiv ScienceSearch

arXiv · 2310.00561

CausalGPS: An R Package for Causal Inference With Continuous Exposures

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.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Naeem Khoshnevis, Xiao Wu, Danielle Braun. 2023-10-01. CausalGPS: An R Package for Causal Inference With Continuous Exposures. https://arxiv.org/abs/2310.00561

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Meta-analysis with the glmmTMB R package

Two common formulations of meta-analytical models include the standard two-stage normal-normal models, which synthesise estimated effect sizes, and the one-stage generalised linear mixed model (GLMM), which directly model the underlying outcome data across studies. The general-purpose glmmTMB R package provides flexible response distributions and random-effect covariance structures through Template Model Builder (TMB). Its existing functionality can fit one-stage meta-analytic GLMM specifications. However, incorporating known sampling variances and covariances in the conventional two-stage inverse-variance formulation of meta-analysis was previously not easily accomplished in glmmTMB. Here, we introduce equalto, a new covariance structure in glmmTMB that allows users to supply a known sampling error variance-covariance matrix when fitting meta-analytic models. This enables explicit modelling of heteroscedasticity and dependence among sampling errors. Using simulations, we show that glmmTMB produces estimates identical to those from the corresponding metafor package functions for normal-normal models and similar estimates for GLMM specifications. We illustrate these models using published meta-analysis datasets in medicine, evolutionary ecology, and the social sciences. With the addition of the equalto covariance structure, glmmTMB now provides a unified and flexible framework for fitting two-stage normal-normal models and one-stage meta-analytic GLMMs, including multivariate specifications. These models can be fitted using the same glmmTMB() function, expanding the R toolkit available for evidence synthesis.

stat.CO

Edgewise Envelopes Between Balanced Forman and Ollivier-Ricci Curvature

Evaluating Ollivier-Ricci (OR) curvature on large-scale graphs is computationally prohibitive due to the necessity of solving an optimal transport problem for every edge. We bypass this bottleneck by deriving explicit, two-sided, piecewise-affine transfer moduli between the transport-based OR curvature and the combinatorial Balanced Forman (BF) curvature. We establish deterministic bounds for $\mathfrak{c}_{\rm OR}(i,j)$ parameterized by 2-hop local graph combinatorics, reducing the edgewise evaluation complexity from an optimal transport linear program to a worst-case $\mathcal{O}\left(\max_{v \in V} \operatorname{deg}(v)^{2.5}\right)$ time, entirely eliminating the reliance on global solvers. Empirical scalability benchmarks confirm these theoretical guarantees, demonstrating that the proposed transfer moduli yield significant asymptotic and constant-factor speedups over the steep polynomial scaling of exact OR evaluation. Furthermore, the tightness of these bounds is validated via distributional analyses on canonical random graphs and empirical networks, with the derived analytical bands enclosing the empirical distributions independent of degree heterogeneity, geometry, or clustering, providing a scalable, computationally efficient framework for rigorous statistical network analysis.

stat.CO

Markov Chain Monte Carlo with Diffusion Paths

Sampling from multimodal distributions is a longstanding challenge for classical local Markov chain Monte Carlo (MCMC) methods. A popular remedy is to introduce a sequence of intermediate distributions that interpolate between the target and a simpler reference. The classical choice, tempering, raises the density to a power, but distorts the relative weights of asymmetric modes and can lead to poor mixing. We instead propose interpolating along the diffusion path, the marginals of a noising diffusion process that carries the target toward a Gaussian. This path preserves the relative weights of the modes and enjoys favorable mixing properties, which we make precise through a spectral-gap analysis of the corresponding ideal transition kernel. Sampling along the path requires its intermediate scores, which can be estimated from the unnormalized target through variational approaches, yielding only an approximate sampler. To remove the resulting bias, we introduce the Metropolis-adjusted diffusion path (MAD-Path) sampler, which corrects the diffusion-path proposal in an augmented path space and leaves the target invariant regardless of the accuracy of the learned score or the discretization error. We further quantify how these two errors affect the acceptance probability, providing guidance for practical tuning. Experiments on a range of Bayesian posteriors show that MAD-Path improves global exploration and mode-weight estimation relative to tempering-based MCMC methods and unadjusted diffusion samplers.

stat.CO