J Plant Ecol ›› Advance articles     DOI:10.1093/jpe/rtaf220

• Method • Previous Articles     Next 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, 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, 12 China

    *Corresponding authors: lai@njfu.edu.cn (J.L.) or maolingfeng2008@163.com (L.M.)

  • Received:2025-09-16 Accepted:2025-12-03 Published:2025-12-23
  • 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 extends the concept of average shared variance (ASV) to SARs, enabling the decomposition of total model R² into unique and shared contributions of spatial and non-spatial predictors. The package calculates individual R² values for spatial effects and environmental variables that sum exactly to the total model R², thereby providing a new measure of predictor importance. We illustrate 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.

Key words: Average shared variance, Hierarchical portioning, R package, spatial autocorrelation, Variation partitioning

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