NR 245
Lab 3: Spatial
autocorrelation
- Download
the table autocorr from the NR245 folder of the share drive to your
account. Join this to your BG_GF_LC2 layer using the BGKEY field (in TOC,
right click on BG_GF_LC2>>joins>>tabular join). However, we’re
going to need to eliminate one row that has a bunch of zero values for
Census data. In my table it is row 5, also ObjectID 5, but it may be
different in your table. To find it, look for the MED.HH.INC column and
scroll down in it until you find a zero value in that column. That is the
row you want to delete. It should be missing all the Census data, starting
with MED.HH.INC. Click on the row to highlight (select) it. Then right
click on that layer in the table of contents and click
selection>>switch selection. Now export (right click>>export data)
that selection to a new layer in your geodatabase called BG_GF_Census.
When you load the resulting layer in ArcMap you’ll notice it is missing
one polygon, which happens to be mostly park land.
- Now
we’ll run some simple SA analyses. Open Arc toolbox and go to spatial
statistics tools>>analyzing patterns>>spatial autocorrelation.
Double click on it, choosing BG_GF_census as the input, P_coarseveg as the
input field, checking display output graphically, choosing “row” as the
type of standardization, and accept all the other defaults. Click OK. You
will see summary results in the graphic output window. What is the Moran’s
index score? Briefly give the result summarized in the window. Hit close
and then look at the results in the toolbox reporting window (the one that
now says “completed” at the top). What is the Z score? Keep in mind that
the critical values for a z statistic at a 95% confidence level are -1.96
and +1.96. This is because 95% of the area on a standard normal
distribution is between -1.96 and 1.96. At the 99% confidence levels those
thresholds are positive and negative 2.58. For more info see http://members.tripod.com/~RichardBowles/maths/proportion/proportion.htm.
- Now
try running SA for some other variables and briefly report each result,
including the confidence level at which it is significant for:
- P_baresoil
- P_water
- Median
household income (MED_HH_INC)
- Robbery
rate (Robb05)
- Now
we’ll do a local hotspot analysis using localmoran. Before doing this,
create a new folder in your account called SA in Arc Catalog. In it,
create a new geodatabase called SA as well
(File>>new>>personal geodatabase). Into your folder copy a
symbology file called zscore from here. Then
close Arc Catalog. This hotspot analysis will look at the Moran
statistic variably across space. Click on spatial statistics
tools>>mapping clusters>>cluster and outlier analysis
(Anselin). Choose BG_GF_Census as the input, Robb05 (robbery rate) as the
input field, and save the output as a feature class in your SA
geodatabase, calling it LISA_rob1. Under standardization, choose “row.”
Set distance band to 2000. Leave
everything else at the default values. You should see the new feature
class added at the end. Open its symbology window and click “import.”
Choose the lyr file you just downloaded and choose to apply it to the
LMzInvDst variable. If the symbology import doesn’t work, try doing, try
creating your own lyr file at spatial statistics
tools>>utilities>>Z score rendering). Take a screencapture and
interpret the map you see. Keep in mind that this is mapping Z scores and
that the same critical values apply as mentioned earlier. Keep in mind
also that for LocalMoran positive
and significant (red) values mean similarity of values in space and negative and significant (blue) values
mean systematic dissimilarity, or negative spatial autocorrelation.
Try this now using the Getis method (spatial statistics
tools>>mapping clusters>>hot spot analysis with rendering).
Choose the same input layer and field as last time, and for output also
save it in SA.mdb, but call it Getis_rob and call the output lyr file the
same thing. Also choose a distance band of 2000 meters. When it produces
the output, you’ll need to open the symbology window, and use the import
button to apply the newly created lyr file to the Zscore field (Gi2000).
Take a screencapture and note the differences with the Moran. You’ll note that the z statistic associated with the output
of the Getis statistic has a different interpretation from LocalMoran. It combines
information from the original map with the autocorrelation statistics by
making areas that are spatially
autocorrelated and have high value red and areas that are spatially
autocorrelated but with low values blue. If you have time, you can try an
alternative approach. Go back to the local Moran tool (cluster and Outlier
analysis) and choose everything the same as before, only this time change
“conceptualization of spatial relationships” to “polygon contiguity” and
leave distance band blank. This means that polygons are considered
neighbors only when touching (note this can also be done for the Getis
statistic when you use the Hotspot analysis tool without rendering). When
it’s done go to symbology and click “import” then choose your z-score
layer file used at the beginning of step 4. When it asks for a values
field, choose LMzContig. Take a look—you should see a smaller number of autocorrelated
polygons than with the original Local Moran.
- Now try the same thing using the parcel
layer from last week. Again choose the cluster and outlier analysis, but
this time choose parcels_R as the input layer and assessed property value
(assessed_tot) as the input variable (note that I had originally suggested
using the “price” variable in these instructions; if you’ve already done
that, that’s fine—just turn in what you have) choosing “row”
standardization and Inverse Distance
as the spatial method. Leave
the distance band blank. Output this again to your geodatabase. Run it
and again, in the symbology window, import the Zscore lyr file. Look at
the output and compare it to a graduated color map of price. What is the
hoptspot analysis appear to be showing you? Take screencapture of the map
showing the z scores. If you have time, try the same parcel level analysis
with the local Getis tool (spatial statistics tools>>mapping
clusters>>hot spot analysis). Choose the same inputs, but change the
name of the ouput to Getis_price, choose inverse distance output, row
standardization and a distance band threshold of 500 meters. Again apply
the zscore .lyr file but this time choose GiInvDst as the variable to
apply it to and look at the difference.
- Now
we’re going to run a regression in S Plus but look at the residuals to see
if they are spatially autocorrelated. Load up the BG_GF_census layer into
Splus using File>>import data>>from database (using the
instructions of week 1). Go to statistics>>regression>>linear.
Input the following model to predict the variation in tree cover, using
BG.GF.census as your data set:
P.coarse.veg~AVE.HH.SZ+P.HS.+POP00.SQMI+MED.HH.INC+P.SFDH+P.Protland+d2down+d2ramp.
Hit apply. You’ll note that one variable (plus the intercept, which you
don’t need to worry about) is not significant at the 95% confidence level.
You should get a good R-squared for this. Copy the table of results from S
Plus into your document and report which variable (there should only be
one) is not significant and how you know to drop that variable and rerun
it. Rerun the model without that variable and also clicking on the results
tab and checking the “residuals” box under “saved results,” choosing
BG_GF_Census as the table to save it in. If you look at the BG.GF.Census
table after hitting apply, you should see a column at the far end of the
table called residuals.
- Now
let’s output these back to Arc Map. Go to file>>export
data>>to database. Choose Data target as MS Access, brose to your
NR245 geodatabase, Choose resid as the output table name, and click on the
filter tab, where you will choose the preview columns checkbox, and then
select to export (by shift-clicking) only BKGKEY and residuals. Then click
OK. If it doesn’t work, it may be because your geodatabase is already open
in Arc Catalog or Arc Map.
- Now,
open Arc Map and load BG-GF-Census as well as the “resid” table you just
created. Do a tabular join to join resid to BG_GF_Census. Then, run a
quick Moran test on those residuals (you could also do this in Splus, but
it’s easier in Arc Map), by going to spatial statistics
tools>>analyzing patterns>>spatial autocorrelation. Choose
BG_GF_Census as the input table and Residual as the input field and choose
to standardize by row. You can
leave the distance band blank. Interpret the results. Are your residuals
independent and random, or spatially autocorrelated? Now run a cluster and
outlier analysis using the local Moran statistic, like we did above
(spatial statistics tools>>mapping clusters>>cluster and
outlier analysis). Choose the same table and fields, as you just did, and
change standardization to “row.” Then click OK and map the result using
the Zscore lyr file again and take a screencapture.
- Assemble
screencapture and text into a file and upload.