我正在使用spgwr::ggwr()
泊松模型和对数链接函数来拟合广义地理加权回归。结果提供了局部系数估计,但我错过了如何获得它们的标准误差(或 t 统计量)来计算伪 p 值。
下面是一个使用SpatialEpi::NYleukemia
数据集的玩具示例:
library(SpatialEpi)
library(spgwr)
## Load data
data(NYleukemia)
population <- NYleukemia$data$population
cases <- ceiling(NYleukemia$data$cases * 100)
centroids <- latlong2grid(NYleukemia$geo[, 2:3])
# data frame
nyleuk <- data.frame(centroids, cases, population)
# set coordinates as vector
coordny <- cbind(centroids[,1],centroids[,2])
# set a kernel bandwidth
bw <- 0.5
# fit ggwr()
m_pois <- ggwr(cases ~ offset(log(population)),
data = nyleuk, gweight = gwr.Gauss,
adapt = bw, family = poisson(link="log"),
type="working", coords = coordny)
# returns spatial point with coefficients
# but no standard errors :(
head(m_pois$SDF@data)
有什么办法可以得到系数的标准误差?
谢谢!