Want to create a 'spatial lag' variable on a polygon fishnet

Discussion created by naseltzer on Oct 25, 2013
Latest reply on Oct 26, 2013 by TKONG
I have about 230 shapefiles which are polygon fishnets. For each fishnet there is a variable called 'foo' in the attribute table and each cell, or feature, has a value of 1 or 0. What I want to do is go through each shapefile and add a new variable 'bar' which is, for each feature, the count of the surrounding features where foo ==1. Could someone please explain to how to go about doing this, and if possible how it can be automated?

My purpose for doing this is to create a 'spatial lag'. When I'm done, I'm going to be exporting the attribute tables into Stata or R to conduct more traditional statistical analysis. If there is a simpler way or an existing tool that creates spatial lags in a more sophisticated way, please let me know.

Thank you so much for your help.