Spatial Autocorrelation (Morans I) (Spatial Statistics) 

Release 9.2
Last modified January 9, 2009 
Print all topics in : "Tools" 
Measures spatial autocorrelation based on feature locations and attribute values.
Learn more about how Spatial Autocorrelation: Moran's I works
Illustration
Usage tips
Given a set of features and an associated attribute, Global Moran's I evaluates whether the pattern expressed is clustered, dispersed, or random. When the Z score indicates statistical significance, a Moran's I value near +1.0 indicates clustering while a value near – 1.0 indicates dispersion.
The Global Moran's I function also calculate a Z score value that indicates whether or not we can reject the null hypothsis. In this case, the null hypothesis states "there is no spatial clustering". In this tool, the Z Score is based on Randomization Null Hypothesis computation. For more information on Z scores, see What is a Z Score?.
To determine if the Z score is statistically significant, compare it to the range of values for a particular confidence level. For example, at a significance level of 0.05, a z score would have to be less than – 1.96 or greater than 1.96 to be statistically significant.
The Moran's I value and associated Z score are written to the Command window and passed as derived output.
The input field you select should only contain positive numeric values. Negative weights will be converted to zero for the calculations.
The values in the input field should have at least some variation. The statistic will not compute if the values have no variation (if they are all one value). If you have incident data, consider using the Collect Events tool before using this tool.
The distance used for analysis should be based on your understanding of spatial interaction among the features being analyzed.
The units of the "Distance Band or Threshold Distance" parameter are the units of the input feature class' coordinate system.
Any value entered for the "Distance Band or Threshold Distance" parameter is not considered when "Inverse Distance", "Inverse Distance Squared", "Polygon Contiguity" or "Get Spatial Weights from File" are selected for the "Conceptualization of Spatial Relationships" parameter.
When using the tool in scripting, use "false" for the Display Output Graphically parameter. If you do not select false, the popup graphic will appear and your script will not complete until you click "Close".
When output is shown graphically, a separate graphics dialog box will be displayed. Therefore, the output should not be displayed graphically (set display_output_graphically to FALSE) in batch operations.
For line and polygon features, feature centroids are used in the computations.
Calculations are based on either Euclidean or Manhattan distance and require projected data to accurately measure distances.
Current map layers may be used to define the input feature class. When using layers, only the currently selected features are used in the Moran's I operation.
In ArcGIS version 9.2, the "Global" standardization option has been removed. Global standardization returns the same results as no standardization. Models built with previous versions of ArcGIS that use the Spatial Autocorrelation tool with the Global standardization option will need to be rebuilt.
The "Display Output Graphically" parameter will only work on the windows operating system. When set to true it will display the results of the tool graphically.
See the Modeling Spatial Relationships help page for further explanation of this tools parameters.
The environment settings do not have an effect on this tool.
Command line syntax
An overview of the Command Line window
SpatialAutocorrelation_stats <Input_Feature_Class> <Input_Field> <Display_Output_Graphically> <Inverse Distance  Inverse Distance Squared  Fixed Distance Band  Zone of Indifference  Polygon Contiguity (First Order)  Get Spatial Weights From File> <Euclidean Distance  Manhattan Distance> <None  Row > <Distance_Band_or_Threshold_Distance> {Weights_Matrix_File}
Parameter  Explanation  Data Type 
<Input_Feature_Class> 
The feature class for which spatial autocorrelation will be calculated.

Feature Layer 
<Input_Field> 
The numeric field used in measuring spatial autocorrelation.

Field 
<Display_Output_Graphically> 
Specifies whether the tool will display the Moran's I and z score values graphically.

Boolean 
<Inverse Distance  Inverse Distance Squared  Fixed Distance Band  Zone of Indifference  Polygon Contiguity (First Order)  Get Spatial Weights From File> 
Specifies how spatial relationships between features are conceptualized.

String 
<Euclidean Distance  Manhattan Distance> 
Specifies how distances are calculated when measuring spatial autocorrelation.

String 
<None  Row > 
The standardization of spatial weights provides more accurate results.

String 
<Distance_Band_or_Threshold_Distance> 
Specifies a distance cutoff value. When determining the neighbors for a particular feature, features outside the specified Distance Band or Threshold Distance are ignored in the cluster analysis. The value entered for this parameter should be in the units of the Input Feature Class' coordinate system.A value of zero indicates that no threshold distance is applied. This is only valid with the "Inverse Distance" and "Inverse Distance Squared" spatial conceptualizations.This parameter has no effect when "Polygon Contiguity" and "Get Spatial Weights From File" spatial conceptualizations are selected.

Double 
{Weights_Matrix_File} 
The pathname to a file containing spatial weights that define spatial relationships between features.

File 
workspace e:\project93\data SpatialAutocorrelation cancernm.shp RATE true 'Inverse Distance' 'Euclidean Distance' None # #
Scripting syntax
About getting started with writing geoprocessing scripts
SpatialAutocorrelation_stats (Input_Feature_Class, Input_Field, Display_Output_Graphically, Conceptualization_of_Spatial_Relationships, Distance_Method, Standardization, Distance_Band_or_Threshold_Distance, Weights_Matrix_File)
Parameter  Explanation  Data Type 
Input_Feature_Class (Required) 
The feature class for which spatial autocorrelation will be calculated.

Feature Layer 
Input_Field (Required) 
The numeric field used in measuring spatial autocorrelation.

Field 
Display_Output_Graphically (Required) 
Specifies whether the tool will display the Moran's I and z score values graphically.

Boolean 
Conceptualization_of_Spatial_Relationships (Required) 
Specifies how spatial relationships between features are conceptualized.

String 
Distance_Method (Required) 
Specifies how distances are calculated when measuring spatial autocorrelation.

String 
Standardization (Required) 
The standardization of spatial weights provides more accurate results.

String 
Distance_Band_or_Threshold_Distance (Required) 
Specifies a distance cutoff value. When determining the neighbors for a particular feature, features outside the specified Distance Band or Threshold Distance are ignored in the cluster analysis. The value entered for this parameter should be in the units of the Input Feature Class' coordinate system.A value of zero indicates that no threshold distance is applied. This is only valid with the "Inverse Distance" and "Inverse Distance Squared" spatial conceptualizations.This parameter has no effect when "Polygon Contiguity" and "Get Spatial Weights From File" spatial conceptualizations are selected.

Double 
Weights_Matrix_File (Optional) 
The pathname to a file containing spatial weights that define spatial relationships between features.

File 
# Analyze crime data to determine if spatial patterns are statistically significant # Import system modules import arcgisscripting # Create the Geoprocessor object gp = arcgisscripting.create() # Local variables... workspace = "C:/project93/data" crime_data = "burglaries.shp" try: # Set the current workspace (to avoid having to specify the full path to the feature classes each time) gp.workspace = workspace # Obtain Nearest Neighbor Ratio and Z Score # Process: Average Nearest Neighbor... nn_output = gp.AverageNearestNeighbor_stats(crime_data, "Euclidean Distance", "false", "#") nn_values = nn_output.split(";") print "The nearest neighbor index is: " + nn_values[0] print "The z score of the nearest neighbor index is: " + nn_values[1] # Obtain General G and Z Score # Process: High/Low Clustering (GetisOrd General G)... hlc_output = gp.HighLowClustering_stats(crime_data, "Count", "false", "Inverse Distance", "Euclidean Distance", "None", "#", "#") hlc_values = hlc_output.split(";") print "The General G value is: " + hlc_values[0] print "the z score of the General G value is: " + hlc_values[1] # Obtain Moran's Index and Z Score # Process: Spatial Autocorrelation (Morans I)... sa_output = gp.SpatialAutocorrelation_stats(crime_data, "Count", "false", "Inverse Distance", "Euclidean Distance", "None", "#", "#") sa_values = sa_output.split(";") print "The Moran's I value is: " + sa_values[0] print "The z score of the Moran's I value is: " + sa_values[1] except: # If an error occurred when running the tool, print out the error message. print gp.GetMessages()