# Nearest Neighbor Analysis for route events

I have events that are on routes. You can think of it as accidents on a highway. I want to do some spatial statistics on it. The road is an M enabled feature class and decision makers want logical distances first.

Is it considered to be a single dimension? What tool in ArcGIS can I use to calculate something like Average Nearest Neighbor?

• Do you want to use "near" in terms of M distance or xy distance? Apr 14, 2016 at 18:13
• @KirkKuykendall - yes, M distance Apr 14, 2016 at 19:06
• Many (or maybe most) accidents occur at intersections. The accidents on different polylines at an intersection might be very close in terms of xy, yet very far apart in terms of M. How will you deal with that? Apr 14, 2016 at 19:09
• The points are calibrated to the route so theoretically, as far as linear referencing / dynamic segmentation is concerned it's all "on" the route Apr 14, 2016 at 20:52
• It seems like this could be treated as a 1 dimensional problem, for example as a histogram where m value ranges are on the x axis, and the height of the bar would represent number of accidents for each m range. Apr 14, 2016 at 21:00

You cannot use standard point pattern statistics because the assumed spatial process is being constrained to a linear process. The assumption of a Poisson distributed Complete Spatial Randomness (CSR) does not hold. The entire problem becomes one-dimensional and expectations based on area need to be constrained to the linear feature thus, the single dimension of the process.

Through the years there has been some work published on point pattern analysis and kernel density estimation on networks and there is even a quasi-commercial ArcGIS toolbox, SANET available. Otherwise you will have to code solutions based on the literature.

The R library spatstat has some limited functions that support network based point pattern statistics, namely "linnet" (defines a network), "lpp" (projects point pattern to a network), "linearK (K-hat statistic constrained to one dimension)" and "envelope.lpp" (for simulation envelopes).