Skip to main content
QUICK REVIEW

[Paper Review] rstap: An R Package for Spatial Temporal Aggregated Predictor Models

Adam Peterson, Brisa N. Sánchez|arXiv (Cornell University)|Dec 26, 2018
Statistical Methods and Bayesian InferenceMathematics18 references3 citations
TL;DR

This paper introduces rstap, an R package that implements Bayesian spatial-temporal aggregated predictor (STAP) models using Stan for full Bayesian inference. The method estimates spatial and temporal scales of built environment features (e.g., fast food restaurants) on health outcomes like BMI or obesity, allowing for continuous, flexible exposure weighting via kernel functions, with key results showing that fast food effects are negligible beyond ~6 miles in urban areas.

ABSTRACT

The rstap package implements Bayesian spatial temporal aggregated predictor models in R using the probabilistic programming language Stan. A variety of distributions and link functions are supported, allowing users to fit this extension to the generalized linear model with both independent and correlated outcomes.

Motivation & Objective

  • To develop an R package that enables Bayesian inference for spatial-temporal aggregated predictor (STAP) models in health and environmental research.
  • To address the limitation of discrete distance bins in distributed lag models by estimating continuous spatial and temporal scales.
  • To allow for flexible, continuous exposure modeling of built environment features (e.g., fast food restaurants) on health outcomes using kernel-weighted cumulative exposure.
  • To support both independent and correlated outcomes, including multilevel and longitudinal data structures.
  • To improve model accuracy and scalability through efficient HMC sampling via Stan and future custom samplers.

Proposed method

  • The STAP model uses a kernel function $\mathcal{K}_s(d/\theta^s)$ to weight exposure from built environment features (BEFs) based on distance $d$ and spatial scale $\theta^s$, ensuring maximum impact at zero distance and decay at larger distances.
  • The exposure variable $X_i(\theta^s) = \sum_{d \in \mathcal{D}_i} \mathcal{K}_s(d/\theta^s)$ represents cumulative exposure to BEFs, with $\theta^s$ estimated as a model parameter.
  • The model extends generalized linear mixed models (GLMMs) by including $\beta$ coefficients for BEF exposure and estimating spatial scale $\theta^s$ as a latent parameter.
  • Multiple BEF types (e.g., fast food, gyms) are modeled with separate $\theta_j^s$ and $\beta_j$ parameters, allowing for class-specific spatial scales.
  • The package uses Hamiltonian Monte Carlo (HMC) via Stan for full Bayesian inference, with weakly informative priors on $\beta$, $\theta^s$, and random effects.
  • For correlated outcomes (e.g., boys and girls at a school), the model uses group-level identifiers and copies exposure data to maintain consistent BEF exposure across outcome groups.

Experimental results

Research questions

  • RQ1What is the optimal spatial scale at which built environment features (e.g., fast food restaurants) influence health outcomes like obesity?
  • RQ2How does the effect of a built environment feature decay with increasing distance from a subject?
  • RQ3Can STAP models improve upon distributed lag models by avoiding discretization of distance and estimating continuous spatial scales?
  • RQ4How do spatial and temporal scales vary across different types of built environment features?
  • RQ5What is the impact of built environment features on health outcomes when outcomes are correlated (e.g., boys and girls at the same school)?

Key findings

  • The effect of a single fast food restaurant placed at zero distance from a school is associated with an odds ratio of 1.001558 (95% CI: 1.000471 to 1.002783) for obesity, indicating a small but detectable effect.
  • The standard deviation of cumulative exposure $X(\theta^s)$ in urban areas is 23.8, meaning a one-standard-deviation increase in exposure (24 additional restaurants at zero distance) corresponds to a 4% increase in obesity odds.
  • The effect of a fast food restaurant becomes effectively negligible (≤1% of maximum impact) at distances beyond approximately 6 miles, as determined by $\mathcal{K}_s(d/\hat{\theta}^s) = 0.01$.
  • For correlated outcomes (e.g., obese boys and girls), the model successfully estimates shared spatial scales with wider uncertainty due to increased model complexity and latent parameters.
  • The model achieves stable posterior inference using Stan’s HMC sampler, with convergence diagnostics indicating reliable sampling across simulated and real data.
  • Future versions of rstap will include a custom HMC sampler with symbolic derivatives to accelerate sampling for large-scale STAP models.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.