I'm trying to do a little spatial analysis--just some simple spatial correlations. I have a data frame consisting of latitude and longitudinal points, a value to model, and a neighborhood indicator. To whit:
d1 <- data.frame(long = runif(n=1000, 10, 10.1),
lat = runif(n=1000, 10, 10.1),
val = rnorm(1000))
d1$neighb <- ifelse(d1$long >= 10.05 &
d1$lat >= 10.05,
"B",
ifelse(d1$long >= 10.05 &
d1$lat < 10.05,
"D",
ifelse(d1$long < 10.05 &
d1$lat >= 10.05,
"A",
ifelse(d1$long < 10.05 &
d1$lat < 10.05,
"C",NA))))
which results in the following
library(ggplot2)
ggplot(d1, aes(y = long, x = lat, color = val)) + geom_point() +facet_wrap(~neighb)
which produces

With apologies for asking such a rudimentary question--how do I estimate the degree of spatial correlation for the val variable?
Thanks!
neighbvariable, as indicated by the plot. Why doesn't this coarse categorization (the 1000 locations to one of four neighborhoods, letters A:D) suffice? – tom Nov 23 '12 at 21:13