Title: | Spatially Explicit Stratified Power |
---|---|
Description: | Assesses spatial associations between variables through an equivalent geographical detector (q-statistic) within a regression framework and incorporates a spatially explicit stratified power model by integrating spatial dependence and spatial stratified heterogeneity, facilitating the modeling of complex spatial relationships. |
Authors: | Wenbo Lv [aut, cre, cph] , Yongze Song [aut] , Zehua Zhang [aut] , Shaoqing Dai [aut] , Jianwu Yan [aut] , Wufan Zhao [aut] |
Maintainer: | Wenbo Lv <[email protected]> |
License: | GPL-3 |
Version: | 1.0-0 |
Built: | 2024-11-26 13:37:32 UTC |
Source: | https://github.com/stscl/sesp |
Spatial fuzzy overlay between variables pairwise
fuzzyoverlay2(formula, data, method = "and")
fuzzyoverlay2(formula, data, method = "and")
formula |
A formula. |
data |
A |
method |
(optional) Spatial overlay method. One of |
A list
overlay
overlay results between pairs of variables
variable
pairwise interacting variable
sim = tibble::tibble(y = stats::runif(7,0,10), x1 = c(1,rep(2,3),rep(3,3)), x2 = c(rep(1,2),rep(2,2),rep(3,3)), x3 = c(rep(1,3),rep(2,2),rep(3,2))) fo1 = fuzzyoverlay2(y ~ .,data = sim, method = 'and') fo1 fo2 = fuzzyoverlay2(y ~ .,data = sim, method = 'or') fo2 fo3 = fuzzyoverlay2(y ~ .,data = sim, method = 'intersection') fo3
sim = tibble::tibble(y = stats::runif(7,0,10), x1 = c(1,rep(2,3),rep(3,3)), x2 = c(rep(1,2),rep(2,2),rep(3,3)), x3 = c(rep(1,3),rep(2,2),rep(3,2))) fo1 = fuzzyoverlay2(y ~ .,data = sim, method = 'and') fo1 fo2 = fuzzyoverlay2(y ~ .,data = sim, method = 'or') fo2 fo3 = fuzzyoverlay2(y ~ .,data = sim, method = 'intersection') fo3
Estimate GWR model coefficients
gwr_betas( formula, data, bw = "AIC", adaptive = TRUE, kernel = "gaussian", intercept = FALSE )
gwr_betas( formula, data, bw = "AIC", adaptive = TRUE, kernel = "gaussian", intercept = FALSE )
formula |
A formula. |
data |
An |
bw |
(optional) The bandwidth used in selecting models. The optimal bandwidth can be
selected using one of two methods: |
adaptive |
(optional) Whether the bandwidth value is adaptive or not. Default is |
kernel |
(optional) Kernel function. Default is |
intercept |
(optional) Whether to include the intercept term in the coefficient |
A tibble
depression = system.file('extdata/Depression.csv',package = 'gdverse') |> readr::read_csv() |> sf::st_as_sf(coords = c('X','Y'), crs = 4326) gwr_betas(Depression_prevelence ~ ., data = depression) gwr_betas(Depression_prevelence ~ ., data = depression, intercept = TRUE)
depression = system.file('extdata/Depression.csv',package = 'gdverse') |> readr::read_csv() |> sf::st_as_sf(coords = c('X','Y'), crs = 4326) gwr_betas(Depression_prevelence ~ ., data = depression) gwr_betas(Depression_prevelence ~ ., data = depression, intercept = TRUE)
Spatially Explicit Stratified Power (SESP) Model
sesp( formula, data, listw = NULL, discvar = "all", discnum = 3:8, model = "ols", durbin = FALSE, overlay = "and", alpha = 0.5, intercept = FALSE, bw = "AIC", adaptive = TRUE, kernel = "gaussian", increase_rate = 0.05, cores = 1, ... )
sesp( formula, data, listw = NULL, discvar = "all", discnum = 3:8, model = "ols", durbin = FALSE, overlay = "and", alpha = 0.5, intercept = FALSE, bw = "AIC", adaptive = TRUE, kernel = "gaussian", increase_rate = 0.05, cores = 1, ... )
formula |
A formula for enhanced stratified power model. |
data |
An |
listw |
(optional) A |
discvar |
(optional) Name of continuous variable columns that need to be discretized. Noted that
when |
discnum |
(optional) Number of discretization. Default all will use |
model |
(optional) The type of linear model used, default is |
durbin |
(optional) Whether to consider spatial durbin terms, default is |
overlay |
(optional) Spatial overlay method. One of |
alpha |
(optional) Controlling the strength of spatial soft constraints, the larger the |
intercept |
(optional) Whether to include the intercept term in the gwr coefficient |
bw |
(optional) The bandwidth used in selecting models. The optimal bandwidth can be
selected using one of two methods: |
adaptive |
(optional) Whether the bandwidth value is adaptive or not. Default is |
kernel |
(optional) Kernel function. Default is |
increase_rate |
(optional) The critical increase rate of the number of discretization.
Default is |
cores |
(optional) Positive integer (default is 1). When cores are greater than 1, use multi-core parallel computing. |
... |
(optional) Other arguments passed to |
A list.
factor
global factor detection result
interaction
global interactive detection results
optdisc
independent variable optimal spatial discretization
allfactor
factor detection results corresponding to different numbers of discreteization
model
regression model used to estimate equivalent q values
Note that when the number of continuous independent variables is small (three or fewer), the built-in spatial explicit
discretization in sesp
may overestimate the variable q value (when there are fewer input independent variables, GWR
tends to overestimate the contribution of each variable). In such cases, it is recommended to discretize these variables
beforehand and then input them into sesp
for computation.
NTD = sf::st_as_sf(gdverse::NTDs, coords = c('X','Y')) g = sesp(incidence ~ ., data = NTD, discvar = 'none', model = 'ols', overlay = 'intersection') g
NTD = sf::st_as_sf(gdverse::NTDs, coords = c('X','Y')) g = sesp(incidence ~ ., data = NTD, discvar = 'none', model = 'ols', overlay = 'intersection') g