Spatial statistics does not mean applying traditional (nonspatial) statistical methods to data that just happens to be spatial (having x- and y-coordinates). Spatial statistics integrate space and spatial relationships directly into their mathematics (area, distance, length, and so on). For many spatial statistics, these spatial relationships are specified formally through a spatial weights matrix file or table.

A spatial weights matrix is a representation of the spatial structure of your data. It is a quantification of the spatial relationships that exist among the features in your dataset (or, at least, a quantification of the way you conceptualize those relationships). Because the spatial weights matrix imposes a structure on your data, you should select a conceptualization that best reflects how features actually interact with each other (giving thought, of course, to what it is you are trying to measure). If you are measuring clustering of a particular species of seed-propagating tree in a forest, for example, some form of inverse distance is probably most appropriate. However, if you are assessing the geographic distribution of a region's commuters, travel time or travel cost might be a better choice.

While physically implemented in a variety of ways, conceptually, the spatial weights matrix is an NxN table (N is the number of features in the dataset). There is one row for every feature and one column for every feature. The cell value for any given row/column combination is the weight that quantifies the spatial relationship between those row and column features.

At the most basic level, there are two strategies for creating weights to quantify the relationships among data features: binary or variable weighting. For binary strategies (fixed distance, K nearest neighbors, Delaunay Triangulation, contiguity, or space-time window) a feature is either a neighbor (1) or it is not (0). For weighted strategies (inverse distance or zone of indifference), neighboring features have a varying amount of impact (or influence), and weights are computed to reflect that variation.

Based on your parameter specifications, the Generate Spatial Weights Matrix tool creates a spatial weights matrix (SWM) file. The spatial relationship values in that file are stored using sparse matrix techniques to minimize disk space, computer memory, and the number of required calculations. These relationship values are utilized in the mathematics of several spatial statistics tools including Spatial Autocorrelation (Global Moran's I), Hot Spot Analysis (Getis-Ord Gi*), and Cluster and Outlier Analysis (Anselin Local Moran's I). While the spatial weights matrix file can conceivably store NxN spatial relationships, in most cases, each feature should only be related to a handful of others. The sparse methodology takes advantage of this by only storing nonzero relationships.

## Additional resources

Getis, Arthur, and Jared Aldstadt. "Constructing the Spatial Weights Matrix Using a Local Statistic." *Geographical Analysis* 36(2): 90–104, 2004.

Mitchell, Andy. *The ESRI Guide to GIS Analysis*,* *Volume 2.* *ESRI Press, 2005.