Hi, i'm trying to do join count analysis on binary data, but i'd like to
create neighborhood's of 'indifference' of 100 meters around each spacial
point.

I've been using dnearneigh to create a neighbor list and knearneigh to
calculate the maximum of the nearest neighbor distances for the upper bound
argument to dnearneigh (so that no observations become islands).

My question is, how do I create neighborhoods based on distance? Should I
just input a number into the upper bound argument of dnearneigh, without
first using knearneigh? If so, what number would correspond to 100 meters
(Euclidean)? (btw, the coordinates are already projected).

Here is a small subsample of my data and analysis. Thanks,

Alberto



# ==========================
# data
dat <- structure(list(present = c(0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 1L, 0L, 1L), x = c(332940L, 316301L,
312714L, 306008L, 312248L, 329276L, 329663L, 341535L, 314761L,
332898L, 332957L, 328332L, 312462L, 330063L, 317808L, 336216L,
333763L, 315049L, 333855L, 324406L), y = c(4305226L, 4303010L,
4316685L, 4309006L, 4319255L, 4311208L, 4316837L, 4306055L, 4301051L,
4300625L, 4330342L, 4303420L, 4308292L, 4307181L, 4292904L, 4304336L,
4313750L, 4297998L, 4314941L, 4315051L)), .Names = c("present",
"x", "y"), class = "data.frame", row.names = c(1L, 2L, 3L, 4L, 5L, 6L,
7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L))


library(spdep)
coords <- cbind(dat$x, dat$y)
k1 <- knn2nb(knearneigh(coords))
maxD <- max(unlist(nbdists(k1, coords))) # upper bound distance btw
neighbors
datnb <- dnearneigh(coords, 0, maxD)
summary(datnb)
print(is.symmetric.nb(datnb))

datlistw <- nb2listw(datnb, glist=NULL, style="B", zero.policy=TRUE)

# join count
joincount.test(as.factor(dat$present), datlistw, zero.policy=TRUE,
    alternative="greater", spChk=NULL, adjust.n=TRUE)
# =========================

	[[alternative HTML version deleted]]

