Using the Average Nearest Neighbor Test for Spatial Clustering

Included in this tutorial:

  • Accessing the Average Nearest Neighbor Tool

  • Tool Parameters and Options

  • Example with Results

Software version in examples: ArcGIS Pro 3.0.0.

Tutorial Data: The tutorial includes demonstration with sample data available here.

Credits: L. Meisterlin with Varisa Tanti and Nikolas Michael (2022)

 

This tutorial demonstrates running an Average Nearest Neighbor test for global clustering and dispersion in ArcGIS Pro.


Accessing the Average Nearest Neighbor Tool

the Average Nearest Neighbor tool within the Geoprocessing Toolbox

Access the Average Nearest Neighbor tool by clicking Geoprocessing in the main ribbon, and clicking through Spatial Statistics Tools > Analyzing Patterns > Average Nearest Neighbor. 

You can also search “Average Nearest Neighbor” in the search bar.


Average Nearest Neighbor Parameters and Options

Average Nearest Neighbor tool dialogue

In the Average Nearest Neighbor dialogue box, you will see these fields: Input Feature Class, Distance Method, Area Field, and a Generate Report option.

Here’s a brief description of the different inputs:

  • Input Feature Class: Specify the input feature class. (These are the features you are testing for clustering.)

  • Distance Method: Specify how distances will be calculates from one feature to another. You will have two options: Euclidean, which calculates the straight line distance (as the crow flies), and Manhattan, which measures the distance along cardinal right angles.

  • Generate Report: Checking this option will create a summary of the results in HTML format.

  • Area: Your study area size in the units of the input feature class’s CRS. The default value is set as the smallest rectangle that encompasses all features in your input feature class.

To execute the tool, click Run.


Example with Results

In the example, with our sample data, the Area parameter is not specified. As a result, the tool defaults to the area of the minimum bounding rectangle encompassing the input features.

IMPORTANT! The results of this test are very sensitive to area. Features distributed evenly across a small area may, indeed, be “clustered” if the relevant study area encompasses a wider region.

tutorial data inputs for the Average Nearest Neighbor example

 

After running the tool, unsurprisingly you will notice that it does not output a new feature class layer. The results are available by clicking View Details at the bottom of the Geoprocessing pane (if it is still open after executing the tool) or by accessing the executed tool in your geoprocessing history. (See Accessing Geoprocessing History & Results.)

Doing so will take you to the results panel, where you will find the results of your Average Nearest Neighbor calculation under the operation’s Messages tab.

The tool calculates values for observed mean distance, expected mean distance, nearest neighbor ratio, z-score, and p-value. The results panel also includes the units used to run the test and the location of the html report generated (so you can access and/or save it, if needed for your notes).

Average Nearest Neighbor calculation completed

access the full results under Messages

 
Previous
Previous

Converting Rasters to Point Features

Next
Next

Calculating the Standard and Directional Distributions of Features