Here are files related to my efforts to compute measures of spatial dependence in per capita personal income growth. Please take a look. I'm not sure I'm using the right dataset, for example, so look at the file I read in and work with. If it's not the most recent version of your work, that's OK, I'm just trying to see how we can think about spatial issues. But if it's not even the right type of data to look at, let me know!

The main point of these files is to pose and answer the question, does our dependent variable display spatial dependence? We can certainly use maps to "eyeball" average growth rates and see if there are regional patterns, etc. But there are statistical measures that answer the question more precisely.

  • Using all 3000+ counties to compute & graph a semivariogram:
    • prw_spatial_ver02.do
    • prw_spatial02.txt
    • semi_variance_grph02.wmf
    • the do file took about 10 to 15 minutes to run, as it was dealing with 3000+ counties; I was guessing about the "right" number of bands (lags) to consider....we do see the semivariogram peak at some number of lags, so I guess that means that the effect of other counties j on county i is a decaying function of the distance between i and j

  • Using only first 200 counties to compute & graph semivariogram AND to compute Moran's I statistic of spatial dependence
    • prw_spatial_ver04.do
    • prw_spatial04.txt
    • graph_semivar04.gph
    • graph_semivar04.wmf
    • I haven't run this for 3000+ counties; it takes a few minutes to run now; not sure about scaling it up
    • I must misunderstand the distance measure I'm using here, because I have some counties who do not have "neighbors" even when I thought I defined the band to go up to 75 miles (about 120 km). Take a look.

  • Using only a handful of counties to compute & really look at several spatial "weighting matrices"
    • I use a file with locations of 3000+ counties and then compute "by hand" the distances between just the first 3 of those counties; then work with those distances to prepare an "inverse distance weighting matrix" and then compare it to the matrices created by the spatwmat command
    • prw_spatial_ver05.do
    • prw_spatial05.txt (print this out with a fixed proportional font and landscape, and you should be able to see the 10 by 10 matrices I print out there....note that I focus only on the first 3 counties because I just wanted to see how the computations worked--but the point is that we now understand how these matrices are put together
    • my code considers 3 alternative weighting matrices; we may find a 4th useful too if we want to use the "contiguous county" dataset