我使用R
库在spgwr
中运行地理加权回归(GWR)。我知道可以使用gwr_fit$SDF
检索每个观察的局部系数和标准误差。
现在我如何使用此信息来确定哪些局部系数具有统计显着性,以便我可以在地图上绘制它们?
library(spgwr)
library(UScensus2000tract)
library(parallel)
# load data
data("oregon.tract")
# calculate Optimal kernel bandwidth
GWRbandwidth <- gwr.sel( log(med.age) ~ log(white) + log(black), data=oregon.tract, adapt=T)
# detect number of CPU cores to go parallel
no_cores <- detectCores() - 1 # Calculate the number of cores
cl <- makeCluster(no_cores)# Initiate cluster
# run GWR Model
gwr_fit <- gwr( log(med.age) ~ log(white) + log(black), data=oregon.tract, adapt= GWRbandwidth, hatmatrix=TRUE, se.fit=TRUE, cl=cl)
# return Sp object with coefficients and standard errors
df <- gwr_fit$SDF