Skip to content
Prev 7574 / 29559 Next

spatial autocorrelation, grids, and the ks-test

On Fri, 5 Feb 2010, ingalapuma wrote:

            
(Please, could anonymous questioners give some indication of their 
standing, for example in an informative signature? The R lists posting 
guide does say: "Some consider it good manners to include a concise 
signature specifying affiliation" - I am one of these some, for good 
reason. Helpers find it much easier to help when they have some idea of 
disciplinary background and motivation of the questioner, and a 
signature field can provide these.)

There are many questions here. Firstly, Moran's I is for continuous 
variables, not categories. For categories, use join count statistics. 
Secondly, the possible dependency in your data will be being driven both 
by any inherent (subatantive) dependency, and by the match (or mismatch) 
between the scale(s) of the phenomena and the resolution of your grid. In 
addition, there may be background variables that drive the dependency, 
like slope or elevation, so observed dependency even for correct scaling 
may not say anything about the effect of contiguity.

You can of course compute spatial autocorrelation of your data (treat them 
as having point support and use a distance criterion like the raster step 
for rook neighbours or the diagonal step for queen neighbours. It's just 
that the test will only reflect your resolution and possibly omitted 
variables. With raster data, especially with fine resolution, one 
typically has many "observations" of the same "natural" entity or object, 
leading to apparent spatial autocorrelation.
I think that you could consider checking your KS results against a better 
null, that is generating from distributions with the same level of spatial 
dependence (or rather not use KS, but fit a model and evaluate it in the 
context of dependence).
In spdep use dnearneigh() to make a list of neighbours. If there is a lot 
of data in the raster, you will not gain any insight anyway - consider 
vigorous subsetting. Contrast the subsets.
Since the KS test maybe isn't a good idea anyway, perhaps starting afresh? 
You'd need to vary your raster resolution anyway to get any idea on how 
scaling works. This is going to take substantial time to do right. In your 
best case, join count tests are insignificant, and you can risk KS, but if 
you can see spatial patterning and have put the question on the table, you 
need an alternative approach.

Roger