I am looking for a way to statistically compare two spatial patterns in shape polygon data (not point pattern analysis).

Let's say I have a city map divided in neighborhoods (barrios), in shape polygon form. For each barrio I have the information of crime occurances (cases) in a given year and also of number of people living in the area.

What I would like to do is to compare the spatial pattern of the crime cases and spatial pattern of population, so to have a formal check of if the clustering of crimes isn't only following the clustering of population.

Is there any such way to test that? Both a measure of how much those patterns are correlated or a inference test of the correlation (to test the null hypothesis) would be very welcome. Graphical assessment does not help me here, as I will be doing such testing for many different data and need to tabulate.

Anyone know how to do this? I usually use R, ArcGIS or GeoDa, but I am open to other possibilities.

  • You should mention you cross-posted at r-sig-geo mailing list as well. Jul 22, 2013 at 7:01
  • 1
    and its a stats question really, so stats.stackexchange.com is probably a better home for this.
    – Spacedman
    Jul 22, 2013 at 7:39
  • "testing for many different data" - xkcd 882 may apply: xkcd.com/882
    – Spacedman
    Jul 22, 2013 at 7:52
  • 1
    Dear @RomanLuštrik, thanks for pointing that. I would not exactly classify it as cross-posting as both sources have different audiences (for one: StackExchange is not only about R), but I thanks anyway as it can indeed be helpful for future readers to know that the question showed up in R-list (although it seems that did not touch people there)
    – FVb
    Jul 22, 2013 at 16:29
  • 1
    Have you considered OLS or GWR modeling?
    – Barbarossa
    Oct 9, 2013 at 19:10

3 Answers 3


To answer your question directly, crime obviously follows population, just like disease or any other human "event" you might be measuring. To directly compare you could normalise both population and crime figures to z-scores, and classify each region as HH, LL, HL, LH, or come up with a way to combine the figures, but I think to answer your question you need to change what you are asking slightly.

I think you want to understand if there are clusters of criminal activity, taking into account the population. Which would mean you would be interested in clusters of the "proportion or rate of crime". Proportions and rates are different, but the simple answer is the proportion which is the number of crime events divided by the population for the same region and period. Applied Spatial Statistics for Public Health Data (Walter, 2004) gives a good overview of the difference between rates and proportions and their applications. Application to crime would be a little different, someone can be assaulted more than once in the same region, but they can't get the same disease twice, although perhaps murder is an exception. The devil is in the details and what you ultimately want to get out of your study.

Next you need the statistical tools to identify clustering or otherwise in your regions. First you need to look at global indexes of spatial autocorrelation, such as Moran's I and Geary's C. The global indicators do have a slightly different meaning, Moran's I is related to spatially weighted covariances, and Geary's C is squared differences. In their basic form, Moran's I is better suited to population studies and Geary's C is better for sample studies, but either can be adapted to the other role (although I suspect few GIS would implement this-I read about it in fairly contemporary literature).

Subsequently you should look at local indicators of spatial association, like local Moran's I and Getis Ord's G and G*. The location indicators are more focused on identifying which spatial units are significantly clustered for low or high levels of crime, or the inverse (think of a spatial unit with low crime surrounded by high crime and vice versa).

All of these statistical tools have associated methods to measure confidence associated with them, so that you can say that the proportion of crime in a particular region is/is not significantly strongly/weakly clustered/uniform. ESRI have a number of pages describing these types of statistics, but there is some really good contemporary scientific literature out about them too. Both ArcGIS and Geoda have some forms of these statistical tools.

  • Welcome to gis.se Craig! Could you provide links to the "really good contemporary scientific literature" you mention? That would be great. thanks!
    – underdark
    Aug 17, 2014 at 18:13
  • 1
    Chen Y (2013) New Approaches for Calculating Moran’s Index of Spatial Autocorrelation. PLoS ONE 8(7): e68336. doi:10.1371/journal.pone.0068336 (this is an excellent paper on the subject) Aug 18, 2014 at 14:57

You might find CrimeStat useful for this:



I would first make a join of the two tables crime and population. Then I would add another column where I calculate the crime case per population, simply divide the crime case column by the population coloumn. Works if the numbers refer to the exact same areas. Then you can visualize this column in a choropleth map and immediately see where the crime is relatively high or low in relation to the Population. You could do all These steps in qgis for instance.

  • Visualizing the data is always a good idea. However, it appears you may have overlooked the last part of the question, which says "graphical assessment does not help me here."
    – whuber
    Jul 17, 2014 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.