> Script Details
Nearest Neighbor Analysis / Event-Event Distances
report inappropriate content
Dr Michael Sawada
Jun 11 2002
Status of work
ArcScripts is intended for the free exchange of scripts and tools related to ESRI software products. Please alert the moderator if this script is a demo, trial-version, or an advertisement for a retail product.
Via a user interface, performs basic Nearest Neighbor Analysis (Clark & Evans 1954) and gives summary statistics of the point distribution (event-to-event) in both corrected (for edge effects via Donnelly 1978 – see ) & uncorrected versions. Nearest neighbor distances can be added to feature table. For ArcGIS 8.1.
1. Select any point layer (or a multipoint layer).
2. The program defines a convex polygon (hull or envelope) around the points for you.
3. Polygon is drawn as a graphic (Optional – none).
4. Output is presented for the Nearest Neighbor Index in both the corrected (for edge effects) and uncorrected versions and ancillary variables (detailed in readme.pdf).
5. All calculations are done within the current dataframe's projection.
6. Select any polygon layer (with a single polygon) that contains the points being analyzed.
7. Buffer (in map units) any polygon used in analysis (either automatic or user specified) to increase the area (also can expand a convex envelope).
8. Add nearest neighbor distances for each point to the feature table along with the FIDs of the nearest points.
9. All graphic elements can be deleted from the dataframe using the "Delete Graphics" button.
10. Statistical output can be saved to a textfile and automatically added as a standalone table to the current dataframe.
Basic Instructions – Detailed in
Written in Visual Basic for Applications (VBA). A single user form is to be associated with a UIControlButton. This procedure is in the readme.pdf file within the zip archive.
Multipoint layers are supported in this version for calculation only. Since a multipoint layer only has one record for all points, nearest neighbor distances and OIDs will not be appended to the feature table of a multipoint layer.
The nearest neighbor index (NNI) is based on the average nearest neighbor distance between all points (events) and is not very useful for hypothesis testing on point-patterns - for various reasons e.g., the mean is not a robust indicator, reflexive neighbors are often high etc. I wrote this program to introduce 2nd year students to spatial statistics because the NNI has great intuitive appeal. Specifically, by varying the convex polygon size and shape (convex hull vs. convex envelope and buffering of both) you can explore how sensitive the NNI is to the shape and size of the area defining the point (event) distribution – the expected value and variance of the NNI are a function of the area and perimeter of the region defining the event distribution). Secondly, students can change the map-projection they are using and see how this affects the NNI. Finally, by adding the nearest neighbor distances to the feature table, students can be introduced to more robust point-pattern analysis techniques such as G-hat which can be derived from the distribution of nearest neighbor distances....
the complete description can be found in the readme.txt file included in the zipfile download.