localmoran(spdep)
localmoran()所属R语言包:spdep
Local Moran's I statistic
局部Moran的I统计
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The local spatial statistic Moran's I is calculated for each zone based on the spatial weights object used. The values returned include a Z-value, and may be used as a diagnostic tool. The statistic is:
的局部空间统计莫兰的我反对使用空间权重的基础上为每个区域计算。返回的值包括一个Z值,并可以被用作一种诊断工具。统计信息是:
, and its expectation and variance are given in Anselin (1995).
和其期望和方差Anselin(1995)中给出。
用法----------Usage----------
localmoran(x, listw, zero.policy=NULL, na.action=na.fail,
alternative = "greater", p.adjust.method="none", mlvar=TRUE,
spChk=NULL)
参数----------Arguments----------
参数:x
a numeric vector the same length as the neighbours list in listw
一个数值向量相同的长度的邻居列表中listw
参数:listw
a listw object created for example by nb2listw
例如创建一个listw对象的nb2listw
参数:zero.policy
default NULL, use global option value; if TRUE assign zero to the lagged value of zones without neighbours, if FALSE assign NA
默认为空,请使用全局选项的值,如果真没有邻居的滞后值的区域分配了零,如果为FALSE分配NA
参数:na.action
a function (default na.fail), can also be na.omit or na.exclude - in these cases the weights list will be subsetted to remove NAs in the data. It may be necessary to set zero.policy to TRUE because this subsetting may create no-neighbour observations. Note that only weights lists created without using the glist argument to nb2listw may be subsetted. If na.pass is used, zero is substituted for NA values in calculating the spatial lag. (Note that na.exclude will only work properly starting from R 1.9.0, na.omit and na.exclude assign the wrong classes in 1.8.*)
一个函数(默认na.fail),也可以是na.omit或na.exclude“ - 在这些情况下,将子集的权重列表中删除NAS的数据。这可能是必要的设置为TRUE zero.policy子集,因为这可能创建没有邻居观测。需要注意的是只重列表创建时没有使用的glist的参数nb2listw可能是子集。如果na.pass使用,零取代NA值计算空间滞后。 (的注意,na.exclude将只从R 1.9.0开始正常工作,na.omit na.exclude分配了错误的类,1.8 *)
参数:alternative
a character string specifying the alternative hypothesis, must be one of greater (default), less or two.sided.
一个字符串,指定其他假设,必须有一个更大的(默认),少或two.sided的。
参数:p.adjust.method
a character string specifying the probability value adjustment for multiple tests, default "none"; see p.adjustSP. Note that the number of multiple tests for each region is only taken as the number of neighbours + 1 for each region, rather than the total number of regions.
一个字符串指定多个测试,默认的“无”的概率值调整; p.adjustSP。请注意,对每个区域的数目的多个测试仅采取作为邻居的数目+ 1为每个区域,而不是区域的总数。
参数:mlvar
default TRUE: values of local Moran's I are reported using the variance of the variable of interest (sum of squared deviances over n), but can be reported as the sample variance, dividing by (n-1) instead; both are used in other implementations.
默认情况下TRUE:价值观的当地莫兰的我都报告使用的可变利息(平方deviances对n的总和)的差异,但可以将报告作为样本方差,除以(N-1),而不是;既被用于其他实现。
参数:spChk
should the data vector names be checked against the spatial objects for identity integrity, TRUE, or FALSE, default NULL to use get.spChkOption()
应的数据向量空间对象的名称进行核对身份完整性,TRUE,否则返回FALSE,默认为空,使用get.spChkOption()
值----------Value----------
参数:Ii
local moran statistic
局部Moran统计
参数:E.Ii
expectation of local moran statistic
期望的局部Moran统计
参数:Var.Ii
variance of local moran statistic
方差的局部Moran统计
参数:Z.Ii
standard deviate of local moran statistic
标准差的局部Moran统计
参数:Pr()
p-value of local moran statistic
p值的局部Moran统计
(作者)----------Author(s)----------
Roger Bivand <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>
参考文献----------References----------
Geographical Analysis, 27, 93–115; Getis, A. and Ord, J. K. 1996 Local spatial statistics: an overview. In P. Longley and M. Batty (eds) Spatial analysis: modelling in a GIS environment (Cambridge: Geoinformation
参见----------See Also----------
localG
localG
实例----------Examples----------
data(afcon)
oid <- order(afcon$id)
resI <- localmoran(afcon$totcon, nb2listw(paper.nb))
printCoefmat(data.frame(resI[oid,], row.names=afcon$name[oid]),
check.names=FALSE)
hist(resI[,5])
resI <- localmoran(afcon$totcon, nb2listw(paper.nb),
p.adjust.method="bonferroni")
printCoefmat(data.frame(resI[oid,], row.names=afcon$name[oid]),
check.names=FALSE)
hist(resI[,5])
totcon <-afcon$totcon
is.na(totcon) <- sample(1:length(totcon), 5)
totcon
resI.na <- localmoran(totcon, nb2listw(paper.nb), na.action=na.exclude,
zero.policy=TRUE)
if (class(attr(resI.na, "na.action")) == "exclude") {
print(data.frame(resI.na[oid,], row.names=afcon$name[oid]), digits=2)
} else print(resI.na, digits=2)
resG <- localG(afcon$totcon, nb2listw(include.self(paper.nb)))
print(data.frame(resG[oid], row.names=afcon$name[oid]), digits=2)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|