J Plant Ecol ›› 2026, Vol. 19 ›› Issue (2): rtaf220.DOI: 10.1093/jpe/rtaf220

• Method • Previous Articles    

Quantifying spatial and environmental effects in spatial autoregressive model with the spatialreg.hp R package

Jiangshan Lai1,2,3*, Yan He1,2, Mi Hou1,2, Guochun Shen4,5, Wenyong Guo4,5 and Lingfeng Mao1,2*   

  1. 1Co-Innovation Center for Sustainable Forestry in Southern China, College of Ecology and Environment, Nanjing Forestry University, Nanjing 210037, China, 2Research Center of Quantitative Ecology, Nanjing Forestry University, Nanjing 210037, China, 3University of Chinese Academy of Sciences, Beijing 100049, China, 4Zhejiang Tiantong Forest Ecosystem National Observation and Research Station, Institute of Eco-Chongming & Research Center for Global Change and Ecological Forecasting, School of Ecological and Environmental Sciences, East China Normal University, Shanghai 200241, China, 5Zhejiang Zhoushan Island Ecosystem Observation and Research Station, Zhoushan 316111, China

    *Corresponding authors. E-mail: lai@njfu.edu.cn(J.L.); maolingfeng2008@163.com(L.M.)

  • Received:2025-09-16 Accepted:2025-12-03 Published:2026-04-01
  • Supported by:
    This research was supported by the National Natural Science Foundation of China (32271551; 32571954), National Key Research and Development Program of China (2023YFF0805803) and the Metasequoia funding of Nanjing Forestry University.

利用“spatialreg.hp”R包量化空间自相关模型中的空间效应与环境效应

Abstract: Ecological data frequently exhibit spatial autocorrelation, whereby geographically proximate sampling units are more similar in species distributions, community composition, or environmental attributes than expected by chance. Spatial Autoregressive models (SARs) address this issue by explicitly incorporating spatial dependence. However, disentangling the relative contributions of spatial structure and ecological predictors remains challenging, particularly in the presence of multicollinearity. The ‘spatialreg.hp’ R package extended the concept of average shared variance (ASV) to SARs, enabling the decomposition of total model R2 into unique and shared contributions of spatial and non-spatial predictors. The package calculated individual R2 values for spatial effects and environmental variables that summed exactly to the total model R2, thereby providing a new measure of predictor importance. We illustrated the package using case studies based on classic spatial datasets. The ‘spatialreg.hp’ package offers ecologists and geographers a new framework for quantifying the interplay between spatial processes and environmental drivers in ecological modeling.

The spatialreg.hp package provides a new ASV-based framework that decomposes SAR model R2 into unique spatial and environmental contributions, enabling clear quantification of spatial and ecological drivers in ecological modeling.

Key words: average shared variance, hierarchical portioning, R package, spatial autocorrelation, variation partitioning

摘要:
生态学数据中常常表现出空间自相关性,即在地理位置上相近的采样单元在物种分布、群落组成或环境属性方面的相似性往往高于随机预期。空间自回归模型(SARs)通过显式地引入空间依赖关系来解决这一问题。然而,在多重共线性的情况下,区分空间结构与生态预测变量的相对贡献仍然具有挑战性。新R包“spatialreg.hp”将“平均共享方差”(ASV)的概念扩展至SAR模型,可将模型总R2分解为空间变量与非空间变量的单独贡献和共享贡献。该包能够精确计算空间效应与环境变量的单个R2值,并确保其和完全等于模型的总R2,从而为量化预测因子重要性提供了一种新的度量方式。本文还通过经典空间数据集案例研究展示了该包的功能。总之,“spatialreg.hp”为生态建模中量化空间过程与环境因子之间的作用提供了新框架。

关键词: 平均共享方差, 层次分割, R语言包, 空间自相关, 方差分解