Analysis of Spatial Stratified Heterogeneity
gdverse consolidates cutting-edge SSH methodologies into a unified toolkit, redefining spatial association measurement as the evolutionary successor to geodetector and GD in the R ecosystem.
Current models and functions provided by gdverse are:
| Model | Function | Support |
|---|---|---|
| GD | gd() |
✔️ |
| OPGD | opgd() |
✔️ |
| GOZH | gozh() |
✔️ |
| LESH | lesh() |
✔️ |
| SPADE | spade() |
✔️ |
| IDSA | idsa() |
✔️ |
| RGD | rgd() |
✔️ |
| RID | rid() |
✔️ |
| SRSGD | srsgd() |
✔️ |
- Install from CRAN with:
install.packages("gdverse", dependencies = TRUE)
- Install development binary version from R-universe with:
install.packages("gdverse", repos = c("https://stscl.r-universe.dev", "https://cloud.r-project.org"), dependencies = TRUE)
- Install development source version from GitHub with:
if (!requireNamespace("pak", quietly = TRUE)) { install.packages("pak") } pak::pak("stscl/gdverse", dependencies = TRUE)
✨ Please ensure that Rcpp is properly installed and the appropriate C++ compilation environment is configured in advance if you want to install gdverse from github.
✨ The gdverse package supports the use of robust discretization for the robust geographical detector and robust interaction detector. For details on using them, please refer to https://stscl.github.io/gdverse/articles/rgdrid.html.
library(gdverse) data("ndvi") ndvi ## # A tibble: 713 × 7 ## NDVIchange Climatezone Mining Tempchange Precipitation GDP Popdensity ## <dbl> <chr> <fct> <dbl> <dbl> <dbl> <dbl> ## 1 0.116 Bwk low 0.256 237. 12.6 1.45 ## 2 0.0178 Bwk low 0.273 214. 2.69 0.801 ## 3 0.138 Bsk low 0.302 449. 20.1 11.5 ## 4 0.00439 Bwk low 0.383 213. 0 0.0462 ## 5 0.00316 Bwk low 0.357 205. 0 0.0748 ## 6 0.00838 Bwk low 0.338 201. 0 0.549 ## 7 0.0335 Bwk low 0.296 210. 11.9 1.63 ## 8 0.0387 Bwk low 0.230 236. 30.2 4.99 ## 9 0.0882 Bsk low 0.214 342. 241 20.0 ## 10 0.0690 Bsk low 0.245 379. 42.0 7.50 ## # ℹ 703 more rows
discvar = names(ndvi)[-1:-3] discvar ## [1] "Tempchange" "Precipitation" "GDP" "Popdensity" ndvi_opgd = opgd(NDVIchange ~ ., data = ndvi, discvar = discvar, cores = 6) ndvi_opgd ## *** Optimal Parameters-based Geographical Detector ## Factor Detector ## ## | variable | Q-statistic | P-value | ## |:-------------:|:-----------:|:--------:| ## | Precipitation | 0.8693505 | 2.58e-10 | ## | Climatezone | 0.8218335 | 7.34e-10 | ## | Tempchange | 0.3330256 | 1.89e-10 | ## | Popdensity | 0.1990773 | 6.60e-11 | ## | Mining | 0.1411154 | 6.73e-10 | ## | GDP | 0.1004568 | 3.07e-10 |
g = gozh(NDVIchange ~ ., data = ndvi) g ## *** Geographically Optimal Zones-based Heterogeneity Model ## Factor Detector ## ## | variable | Q-statistic | P-value | ## |:-------------:|:-----------:|:--------:| ## | Precipitation | 0.87255056 | 4.52e-10 | ## | Climatezone | 0.82129550 | 2.50e-10 | ## | Tempchange | 0.33324945 | 1.12e-10 | ## | Popdensity | 0.22321863 | 3.00e-10 | ## | Mining | 0.13982859 | 6.00e-11 | ## | GDP | 0.09170153 | 3.96e-10 |
Please cite gdverse as:
Lv, W., Lei, Y., Liu, F., Yan, J., Song, Y., Zhao, W., 2025. gdverse: An R Package for Spatial Stratified Heterogeneity Family. Transactions in GIS 29. https://doi.org/10.1111/tgis.70032
A BibTeX entry for LaTeX users is:
@article{lyu2025gdverse, title={{gdverse}: An {R} Package for Spatial Stratified Heterogeneity Family}, volume={29}, ISSN={1467-9671}, DOI={10.1111/tgis.70032}, number={2}, journal={Transactions in GIS}, publisher={Wiley}, author={Lv, Wenbo and Lei, Yangyang and Liu, Fangmei and Yan, Jianwu and Song, Yongze and Zhao, Wufan}, year={2025}, month={mar}, pages={e70032} }
Lv, W., Lei, Y., Liu, F., Yan, J., Song, Y., Zhao, W., 2025. gdverse: An R Package for Spatial Stratified Heterogeneity Family. Transactions in GIS 29. https://doi.org/10.1111/tgis.70032.
Wang, J., Li, X., Christakos, G., Liao, Y., Zhang, T., Gu, X., Zheng, X., 2010. Geographical Detectors‐Based Health Risk Assessment and its Application in the Neural Tube Defects Study of the Heshun Region, China. International Journal of Geographical Information Science 24, 107–127. https://doi.org/10.1080/13658810802443457.
Song, Y., Wang, J., Ge, Y., Xu, C., 2020. An optimal parameters-based geographical detector model enhances geographic characteristics of explanatory variables for spatial heterogeneity analysis: cases with different types of spatial data. GIScience & Remote Sensing 57, 593–610. https://doi.org/10.1080/15481603.2020.1760434.
Luo, P., Song, Y., Huang, X., Ma, H., Liu, J., Yao, Y., Meng, L., 2022. Identifying determinants of spatio-temporal disparities in soil moisture of the Northern Hemisphere using a geographically optimal zones-based heterogeneity model. ISPRS Journal of Photogrammetry and Remote Sensing 185, 111–128. https://doi.org/10.1016/j.isprsjprs.2022.01.009.
Li, Y., Luo, P., Song, Y., Zhang, L., Qu, Y., Hou, Z., 2023. A locally explained heterogeneity model for examining wetland disparity. International Journal of Digital Earth 16, 4533–4552. https://doi.org/10.1080/17538947.2023.2271883.
Cang, X., Luo, W., 2018. Spatial association detector (SPADE). International Journal of Geographical Information Science 32, 2055–2075. https://doi.org/10.1080/13658816.2018.1476693.
Song, Y., Wu, P., 2021. An interactive detector for spatial associations. International Journal of Geographical Information Science 35, 1676–1701. https://doi.org/10.1080/13658816.2021.1882680.
Zhang, Z., Song, Y., Wu, P., 2022. Robust geographical detector. International Journal of Applied Earth Observation and Geoinformation 109, 102782. https://doi.org/10.1016/j.jag.2022.102782.
Zhang, Z., Song, Y., Karunaratne, L., Wu, P., 2024. Robust interaction detector: A case of road life expectancy analysis. Spatial Statistics 59, 100814. https://doi.org/10.1016/j.spasta.2024.100814.
Bai, H., Li, D., Ge, Y., Wang, J., Cao, F., 2022. Spatial rough set-based geographical detectors for nominal target variables. Information Sciences 586, 525–539. https://doi.org/10.1016/j.ins.2021.12.019.
Wang, J., Zhang, T., Fu, B., 2016. A measure of spatial stratified heterogeneity. Ecological Indicators 67, 250–256. https://doi.org/10.1016/j.ecolind.2016.02.052.
Wang, J., Haining, R., Zhang, T., Xu, C., Hu, M., Yin, Q., Li, L., Zhou, C., Li, G., Chen, H., 2024. Statistical Modeling of Spatially Stratified Heterogeneous Data. Annals of the American Association of Geographers 114, 499–519. https://doi.org/10.1080/24694452.2023.2289982.
