I asked a question on the GIS StackExchange site, regarding working spatial correlation/regression in QGIS, and how to implement this in software: Calculating spatial correlation between features from two separate layers in QGIS

But I wanted to ask a question here that is focused more on the validity of the mathematical model that I was thinking of using, and get some ideas about how I could improve it to develop a more realistic model. (The question there was mostly based around software tools/implementation - here I'm curious to learn more about the math).

I am working with the following two datasets:

  1. locations of military bases in the continental US & their corresponding troop levels

  2. nationwide data on rates of violent crime by town/city

I am trying to determine whether the presence of large numbers of active duty military troops in an area is spatially correlated with higher/lower levels of violent crime. That is, are the areas surrounding large military bases more/less violent, on average, than areas that are not near military bases? I am not necessarily looking for a causal relationship - just to see if there is a significant correlation.

I was thinking of using some sort of "gravity" based model that would conceptually look something like this:


In this diagram X,Y,Z represent military bases. a,b,c,d each represent cities (each of which has a violence rate field in its attribute table). The gradient around the bases represents the field of influence, which decreases exponentially with distance away from the base centroid. Larger troop presence equates to a stronger influence relative a smaller base. Each city will be assigned a score based on summing the magnitude of all of the "forces" from all surrounding bases whose influence radius they lay in.

The algorithm that I was thinking of using to do this is as follows:

  • For each military base m, assign a weight W(m) based on the # of troops

  • Select all cities within an r-mile radius of m, and for each city c (where r is some arbitrary maximum threshold distance)

    1. Compute the distance D(m,c), from base m to city c

    2. Add the distance decayed score S for base m to the total score for city c where $$S = \frac{W(m)}{D(m,c)^{2}}$$

  • Each city now has two values associated with it:

    1. The total "troop presence score" all military bases

    2. The per capita "violent crime rate" for that city

  • Finally, I would calculate the Pearson correlation coefficient for these two variables to see if there is a strong correlation between these two figures.

My questions are :

  • Are there any glaring problems with this approach from a statistical perspective?
  • Which alternative mathematical models could I use to determine if there is a spatial correlation between military bases and violent crime rates, using the data sets described above? What would be the pros/cons of each?


  • $\begingroup$ Also, please note that I'm an undergrad student doing this for a GIS class project, so my understanding of statistics (especially spatial statistics) is rather basic - limited to two quarters of introductory stats . I'm sure there are issues with the approach outlined above, but please try to explain the problems with it in relatively simple language (i.e. don't assume advanced knowledge). Also, I realize that many other factors influence violence rates - so I'd like to emphasize again that I'm not (necessarily) looking for a causal relationship here, just trying to measure correlation. $\endgroup$ – J. Taylor Dec 7 '15 at 1:37
  • 1
    $\begingroup$ Yep this is a reasonable approach to the problem. Not sure what else you want someone to say. $\endgroup$ – Andy W Dec 7 '15 at 2:05
  • $\begingroup$ Hi Andy - thanks for your response. I just needed someone with more experience to verify that this made sense before I took the time to write the code, or to provide alternative methods if it didn't make sense. As I said, my knowledge of statistics is really basic, so while this approach intuitively made sense to me, I realize that there are a lot of "gotchas" with statistics and thought I might be overlooking something. $\endgroup$ – J. Taylor Dec 7 '15 at 2:53

If the only question you want to answer is whether there is a correlation between military bases close to a city and violent crime rates, then this is a reasonable approach. However, it is worth bearing in mind that even a very high positive or negative correlation (that is, close to +1 or -1) would not indicate how much difference in crime rates is associated with any given difference in 'troop presence score'. To take a simple numerical example, (1, 2, 3, 4) has a correlation of +1 with (10, 15, 20, 25), but also has a correlation of +1 with (10, 10.1, 10.2, 10.3). If it is of interest to assess how important the relation between troop presence and crime rates is, as compared with that of other variables that may be related to crime rates, then just to know that there is a correlation is of limited value.

An alternative you might consider is to estimate a linear regression of crime rates (C) on troop presence scores (T):


Admittedly you lose something here in that the regression model is not symmetrical between C and T (whereas calculating a correlation coefficient between two variables treats them symmetrically). What you gain, however, is that, the estimated value of the parameter $\beta_2$ provides a measure of the strength of the relation between C and T. Moreover the coefficient of determination ($R^2$) from the regression provides a measure of how much of the total variation in C is associated with variation in T.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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