mat2listw(spdep)
mat2listw()所属R语言包:spdep
Convert a square spatial weights matrix to a weights list object
一个方形的空间权重矩阵转换到权重列表对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The function converts a square spatial weights matrix, optionally a sparse matrix to a weights list object, optionally adding region IDs from the row names of the matrix, as a sequence of numbers 1:nrow(x), or as given as an argument. The style can be imposed by rebuilting the weights list object internally.
该函数将一个正方形的空间权重矩阵,任选的一个权重列表对象的稀疏矩阵,任选添加区域的ID,从该矩阵的行的名称,作为序列号1:NROW(x),或作为参数给出。内部rebuilting的权重列表对象,可被判处的风格。
用法----------Usage----------
mat2listw(x, row.names = NULL, style="M")
参数----------Arguments----------
参数:x
A square non-negative matrix with no NAs representing spatial weights; may be a matrix of class “sparseMatrix”
阿方非负矩阵与不占空间权重的NAS;可能是矩阵类“sparseMatrix”
参数:row.names
row names to use for region IDs
行区域的ID名称使用
参数:style
default "M", unknown style; if not "M", passed to nb2listw to re-build the object
默认的“M”,未知的风格,如果不是“M”,通过nb2listw重新构建对象
值----------Value----------
A listw object with the following members:
Alistw对象具有下列成员:
参数:style
"M", meaning matrix style, underlying style unknown, or assigned style argument in rebuilt object
“M”,这意味着,相关矩阵式风格不明,或指定的样式参数在重建对象
参数:neighbours
the derived neighbours list
在衍生邻居列表
参数:weights
the weights for the neighbours derived from the matrix
来自矩阵的邻居的权重
(作者)----------Author(s)----------
Roger Bivand <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>
参见----------See Also----------
nb2listw, nb2mat
nb2listw,nb2mat
实例----------Examples----------
example(columbus)
coords <- coordinates(columbus)
col005 <- dnearneigh(coords, 0, 0.5, attr(col.gal.nb, "region.id"))
summary(col005)
col005.w.mat <- nb2mat(col005, zero.policy=TRUE)
col005.w.b <- mat2listw(col005.w.mat)
summary(col005.w.b$neighbours)
diffnb(col005, col005.w.b$neighbours)
col005.w.mat.3T <- kronecker(diag(3), col005.w.mat)
col005.w.b.3T <- mat2listw(col005.w.mat.3T, style="W")
summary(col005.w.b.3T$neighbours)
W <- as(as_dgRMatrix_listw(nb2listw(col005, style="W", zero.policy=TRUE)), "CsparseMatrix")
col005.spM <- mat2listw(W)
summary(col005.spM$neighbours)
diffnb(col005, col005.spM$neighbours)
IW <- kronecker(Diagonal(3), W)
col005.spM.3T <- mat2listw(IW, style="W")
summary(col005.spM.3T$neighbours)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|