我似乎在单变量Ripley的K点模式分析结果中发现了差异(图1)。首先,我生成了一个1x1的统一点网格,以查看我的R脚本是否产生了逻辑结果(图2)。研究区域为20x40(图2)。给定完全统一的数据,我不希望在任何搜索距离(r)上看到任何随机或聚集的点模式。随附的脚本用于生成这些结果。在这些受控条件下,为什么只应该有一个统一的点模式,我才能看到聚类和CSR?
require(spatstat)
require(maptools)
require(splancs)
# Local Variables
flower = 0
year = 2013
# Read the shapefile
sdata = readShapePoints("C:/temp/sample_final.shp") #Read the shapefile
data = sdata[sdata$flow_new == flower,] # subset only flowering plants
data2 = data[data$year == year,] # subset flowering plants at year X
data.frame(data2) # Check the data
# Get the ripras estimate of area based on the study area measurements
gapdata = readShapePoints("C:/temp/study_area_boundary.shp") #Read the shapefile
whole = coordinates(gapdata) # get just the coords, excluding other data
win = convexhull.xy(whole) # Ripras will determine a good bounding polygon for the points (usually a variant of Convex Hull)
plot(win)
# Converting to PPP
points = coordinates(data2) # get just the coords, excluding other data
ppp = as.ppp(points, win) # Convert the points into the spatstat format
data.check = data.frame(ppp) # Check the format of the ppp data
summary(ppp) # General info about the created ppp object
plot(ppp) # Visually check the points and bounding area
# Now run the ppa
L.Env.ppp = envelope(ppp, Lest, nsim = 1000, correction = "best", rank =1)
plot(L.Env.ppp, main = "Uniform Test")
abline(v=(seq(1:12)), lty="dotted")
图1
分析结果
图2
统一点和窗口
最佳答案
这些点有规律地分散(有时也称为超分散)。尽管从通俗意义上讲,它们看起来是统一的,但它们背后的点过程本身并不是统一的:如果一致,则点对之间的距离可能会小于一个单位。
为了吸引您注意均匀性的短距离偏差,Ripley's K的性能完全符合设计要求!
关于r - 如何在统一空间数据中考虑CSR和聚类?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17636211/