Simon Fraser University
**Professor Martin A. Andresen - School of Criminology**

**Spatial Point Pattern Test**

Spatial Point Pattern Test in R

Spatial Point Pattern Test GUI

This page provides information regarding a spatial point pattern test I developed as part of my PhD Dissertation. This is a point pattern test that measures the degree of similarity at the local level between two spatial point patterns and is an area-based test: the base, or reference, data set and the test data set.

This spatial point pattern test is not for the purpose of testing point patterns with the null hypotheses of random, uniform, or clustered distributions, but may be used to compare a particular point pattern with these distributions. One advantage of the test is that it can be performed for a number of different area boundaries using the same original point datasets.

The program written to perform the test (see the 2 options below) uses double precision that has at least 14 decimal points when dealing with numbers (percentages of points within an area) less than unity.

The purpose of this spatial point pattern test is to create variability in one dataset so that it can be compared statistically to another dataset. Using a variety of methods now, a "confidence interval" is created for each spatial unit that may be compared to the base dataset. Therefore, statistically significant changes/differences are identified at the local level.

There is a description of the original version of the test, below, but there are now a number of options. The original version, described below, used random sampling without replacement on the test data set to create a confidence interval; this original version is instructive when the base/reference data set is considered fixed, rather than a random outcome. This is the version of the test that is available in the Java program, below. Currently, versions of the test are available that perform random sampling without replacement on both the base and test data sets, a Chi-square version of the test, and a full bootstrap with replacement.

The output of the test consists of two parts. First, there is a global parameter that ranges from 0 (no similarity) to 1 (perfect similarity): the index of similarity, *S*, is calculated as the proportion of spatial units that have a similar spatial pattern within both data sets. Second, the test generates mappable output to show where statistically significant change occurs; i.e. which census tracts, dissemination areas, or other areas have undergone a statistically significant change. Though this spatial point pattern test is not a local indicator of spatial association (LISA, see Anselin 1995) and there is much more to LISA than being able to produce maps of results, it is in the spirit of LISA because the output may be mapped.

The code for running the test is R, including some advances in the test, has been developed by my friend Wouter Steenbeek at the Netherlands Institute for the Study of Crime and Law Enforcement (NSCR), a research institute of the Netherlands Organisation for Scientific Research (NWO). The advances include a bootstrap version of the test using sampling with replacement for both the base and test data sets as well as a difference in proportions test version that was developed by Wouter Steenbeek and Andrew Wheeler at the University of Texas - Dallas.

The R package and installation information can be found here:

Spatial Point Pattern Test in R

If you are not familiar with using R, my friend and co-author Nicolas Malleson in the School of Geography at the University of Leeds developed a graphical user interface (GUI) to perform the test.

The GUI can be found here:

Spatial Point Pattern Test GUI

This project page contains the GUI for download as well as other information regarding the test.

A detailed discussion of the spatial point pattern test is available in an open access journal:

Andresen, M.A. (2016). An area-based nonparametric spatial point pattern test: the test, its applications, and the future. *Methodological Innovations*, 9, Article 12.

The following publications use the spatial point pattern test:

Vandeviver, C., & Steenbeek, W. (2018). The (in)stability of residential burglary patterns on street segments: The case of Antwerp, Belgium 2005 - 2016. *Journal of Quantitative Criminology*, in press.

De Moor, S., Vandeviver, C. & Vander Bekena, T. (2018). Are DNA data a valid source to study the spatial behavior of unknown offenders? *Science & Justice*, 58(5), 315 - 322.

Wheeler, A.P., Steenbeek, W., & Andresen, M.A. (2018). Testing for similarity in area-based spatial patterns: Alternative methods to Andresen's spatial point pattern test. *Transactions in GIS*, 22(3), 760 - 774.

Wu, X., & Lum, C. (2017). Measuring the spatial and temporal patterns of police proactivity. *Journal of Quantitative Criminology*, 33(4), 915 - 934.

Hibdon, J., Telep, C., & Groff, E.R. (2017). The concentration and stability of drug activity in Seattle, Washington using police and emergency medical services data. *Journal of Quantitative Criminology*, 33(3), 497 - 517.

Andresen, M.A., Linning, S.J., & Malleson, N. (2017). Crime at places and spatial concentrations: Exploring the spatial stability of property crime in Vancouver BC, 2003-2013. *Journal of Quantitative Criminology*, 33(2), 255 - 275.

Pereira, D.V.S., Mota, C.M.M., & Andresen, M.A. (2016). The homicide drop in Recife, Brazil: A study of crime concentrations and spatial patterns. *Homicide Studies*, 21(1), 21 - 38.

Pereira, D.V.S., Andresen, M.A., & Mota, C.M.M. (2016). A temporal and spatial analysis of homicides. *Journal of Environmental Psychology*, 46, 116 - 124.

Vaughan, A., Hewitt, A., Andresen, M.A., & Brantingham, P.L. (2016). Exploring the role of the environmental context in the spatial distribution of calls-for-service associated with emotionally disturbed persons. *Policing: A Journal of Policy and Practice*, 10(2), 121 - 133.

Andresen, M.A. (2016). An area-based nonparametric spatial point pattern test: The test, its applications, and the future. *Methodological Innovations*, 9, Article 12.

Hodgkinson, T., Andresen, M.A., & Farrell, G. (2016). The decline and locational shift of automotive theft: A local level analysis. *Journal of Criminal Justice*, 44(1), 49 - 57.

Linning, S.J. (2015). Crime seasonality and the micro-spatial patterns of property crime in Vancouver, BC and Ottawa, ON. *Journal of Criminal Justice*, 43(6), 544 - 555.

Andresen, M.A., & Malleson, N. (2015). Intra-week spatial-temporal patterns of crime. *Crime Science*, 4(1), Article 12.

Melo, S.N., Matias, L.F., & Andresen, M.A. (2015). Crime concentrations and similarities in spatial crime patterns in a Brazilian context. *Applied Geography*, 62, 314 - 324.

Tompson, L., Johnson, S., Ashby, M., Perkins, C., & Edwards, P. (2015). UK open source crime data: Accuracy and possibilities for research. *Cartography and Geographic Information Science*, 42(2), 97 - 111.

Andresen, M.A., & Malleson, N. (2014). Police foot patrol and crime displacement: A local analysis. *Journal of Contemporary Criminal Justice*, 30(2), 186 - 199.

Andresen, M.A., & Malleson, N. (2013). Crime seasonality and its variations across space. *Applied Geography*, 43, 25 - 35.

Andresen, M.A. (2013). *The science of crime measurement: Issues for spatially-referenced crime data*. New York, NY: Routledge.

Andresen, M.A., & Malleson, N. (2013). Spatial heterogeneity in crime analysis. In M. Leitner (ed.) *Crime Modeling and Mapping Using Geospatial Technologies*. New York, NY: Springer, 3 - 23.

Andresen, M.A., & Linning, S.J. (2012). The (in)appropriateness of aggregating across crime types. *Applied Geography*, 35(1-2), 275 - 282.

Andresen, M.A., & Malleson, N. (2011). Testing the stability of crime patterns: Implications for theory and policy. *Journal of Research in Crime and Delinquency*, 48(1), 58 - 82.

Andresen, M.A. (2010). Canada - United States interregional trade: Quasi-points and spatial change. *Canadian Geographer*, 54(2), 139 - 157.

Andresen, M.A. (2009). Testing for similarity in area-based spatial patterns: A nonparametric Monte Carlo approach. *Applied Geography*, 29(3), 333 - 345.

**References**

Anselin, L. (1995). Local indicators of spatial association -- LISA. *Geographical Analysis*, 27(2), 93 - 115.

Ratcliffe, J.H. (2004). Geocoding crime and a first estimate of a minimum acceptable hit rate. *International Journal of Geographical Information Science*, 18(1), 61 - 72.

The original version of the test was computed as follows:

1. Nominate a base dataset and count, for each area, the number of points that fall within it.

2. From the test dataset, randomly sample 85 percent of the points, with replacement. As with the previous step, count the number of points within each area using the sample. This is effectively a bootstrap created by sampling from the test dataset.

An 85 percent sample is based on the minimum acceptable hit rate to maintain spatial patterns, determined by Ratcliffe (2004). Maintaining the spatial pattern of the complete data set is important so we used this as a benchmark for sampling. An 85 percent sample was for the purposes of generating as much variability as possible while maintaining the original spatial pattern. Also note that "replacement" in this context refers to subsequent samples; any one point may only be sampled once per iteration in this procedure to mimic Ratcliffe (2004).

3. Repeat (2) a number of times (200 is the default).

4. For each area in the test data set, calculate the percentage of crime that has occurred in the area. Use these percentages to generate a 95 percent nonparametric confidence interval by removing the top and bottom 2.5 percent of all counts (5 from the top and 5 from the bottom in this case). The minimum and maximum of the remaining percentages represent the confidence interval. It should be noted that the effect of the sampling procedure will be to reduce the number of observations in the test dataset but, by using percentages rather than the absolute counts, comparisons between data sets can be made even if the total number of observations are different.

5. Calculate the percentage of points within each area for the base dataset and compare this to the confidence interval generated from the test dataset. If the base percentage falls within the confidence interval then the two datasets exhibit a similar proportion of points in the given area. Otherwise they are significantly different.