| Title: | Local Indicator of Stratified Power |
|---|---|
| Description: | Implements a local indicator of stratified power to analyze local spatial stratified association and demonstrate how spatial stratified association changes spatially and in local regions, as outlined in Hu et al. (2024) <doi:10.1080/13658816.2024.2437811>. |
| Authors: | Wenbo Lyu [aut, cre, cph] (ORCID: <https://orcid.org/0009-0002-6003-3800>), Yongze Song [aut] (ORCID: <https://orcid.org/0000-0003-3420-9622>), Jiao Hu [aut] (ORCID: <https://orcid.org/0000-0002-9644-9763>) |
| Maintainer: | Wenbo Lyu <[email protected]> |
| License: | GPL-3 |
| Version: | 0.2.0 |
| Built: | 2026-05-19 09:07:25 UTC |
| Source: | https://github.com/ausgis/localsp |
local indicator of stratified power
lisp( formula, data, threshold, distmat, discvar = NULL, discnum = 3:8, discmethod = c("sd", "equal", "geometric", "quantile", "natural"), cores = 1, ... )lisp( formula, data, threshold, distmat, discvar = NULL, discnum = 3:8, discmethod = c("sd", "equal", "geometric", "quantile", "natural"), cores = 1, ... )
formula |
A formula. |
data |
The observation data. |
threshold |
The distance threshold employed to select "local" data. |
distmat |
The distance matrices. |
discvar |
(optional) Name of continuous variable columns that need to be discretized. Noted
that when |
discnum |
(optional) A vector of number of classes for discretization. Default is |
discmethod |
(optional) A vector of methods for discretization, default is using
|
cores |
(optional) Positive integer (default is 1). When cores are greater than 1, use multi-core parallel computing. |
... |
(optional) Other arguments passed to |
A tibble.
gtc = readr::read_csv(system.file("extdata/gtc.csv", package = "localsp")) gtc # Sample 100 observations from the original data to save runtime; # This is unnecessary in practice; set.seed(42) gtc1 = gtc[sample.int(nrow(gtc),size = 100),] distmat = as.matrix(dist(gtc1[, c("X","Y")])) gtc1 = gtc1[, -c(1,2)] gtc1 # Use 2 cores for parallel computing; # Increase cores in practice to speed up; lisp(GTC ~ ., data = gtc1, threshold = 8, distmat = distmat, discnum = 3:5, discmethod = "quantile", cores = 2)gtc = readr::read_csv(system.file("extdata/gtc.csv", package = "localsp")) gtc # Sample 100 observations from the original data to save runtime; # This is unnecessary in practice; set.seed(42) gtc1 = gtc[sample.int(nrow(gtc),size = 100),] distmat = as.matrix(dist(gtc1[, c("X","Y")])) gtc1 = gtc1[, -c(1,2)] gtc1 # Use 2 cores for parallel computing; # Increase cores in practice to speed up; lisp(GTC ~ ., data = gtc1, threshold = 8, distmat = distmat, discnum = 3:5, discmethod = "quantile", cores = 2)