This first map (in yellow/red) was created in ArcGIS. I downloaded a shape file from DIVA GIS which contained basic information about the different administrative boundaries. Then I merged the tables in ArcMap (after a little doctoring in Excel) with data about trees planted downloaded from Tanzania's countrystat website run by the FAO.

The second (in blue/green) was created from the same data in when imported into R.
Creating a spatial weights matrix
w.cols = 1:26w.rows = 1:26
#create spatial weights matrix from neighbor object
w.mat.knn = nb2mat(TZ.knn1, zero.policy=TRUE)
w.mat.dist = nb2mat(TZ.dist.150, zero.policy=TRUE)
image(w.cols,w.rows,w.mat.dist,col=brewer.pal(3,"BuPu"))
#return binary spatial weights matrix
w.mat.knn
#print out of 0s and 1s
#visualize binary spatial weights matrix
image(w.cols,w.rows,w.mat.knn,col=brewer.pal(3,"BuPu"))
#create and visualize distance-based spatial weights matrix;
w.mat.dist = nb2mat(TZ.dist.250, zero.policy=TRUE)
image(w.cols,w.rows,w.mat.dist,col=brewer.pal(9,"PuRd"))
Moran's I test
##for distance = 350
moran.plot(tz$TREES_2008,nb2listw(TZ.dist.350),labels=tz$F1)
moran.test(tz$TREES_2008,nb2listw(TZ.dist.350, style="W"))

######print out from moran.test###
# Moran's I test under randomisation
#data: tz$TREES_2008
#weights: nb2listw(TZ.dist.350, style = "W")
#Moran I statistic standard deviate = 0.7428, p-value = 0.2288
#alternative hypothesis: greater
#sample estimates:
#Moran I statistic Expectation Variance
# 0.011532877 -0.040000000 0.004812588
##for distance = 500
moran.plot(tz$TREES_2008,nb2listw(TZ.dist.500),labels=tz$F1)
moran.test(tz$TREES_2008,nb2listw(TZ.dist.500, style="W"))
##print out##
#Moran's I test under randomisation
#data: tz$TREES_2008
#weights: nb2listw(TZ.dist.500, style = "W")
#Moran I statistic standard deviate = 0.7428, p-value = 0.2288
#alternative hypothesis: greater
#sample estimates:
#Moran I statistic Expectation Variance
# 0.011532877 -0.040000000 0.004812588
##for distance = 1000
moran.plot(tz$TREES_2008,nb2listw(TZ.dist.1000),labels=tz$F1)
moran.test(tz$TREES_2008,nb2listw(TZ.dist.1000, style="W"))
#Moran's I test under randomisation
#data: tz$TREES_2008
#weights: nb2listw(TZ.dist.1000, style = "W")
#Moran I statistic standard deviate = 0.0731, p-value = 0.4709
#alternative hypothesis: greater
#sample estimates:
#Moran I statistic Expectation Variance
# -3.936736e-02 -4.000000e-02 7.496845e-05
A note on spatial autocorrelation
Spatial autocorrelation is an understanding that real-life phenomena tend to be most similar the closer they are together. In nature, things ten to cluster in patches of populations or are spread out in gradient where there is a concentration at one point and a slow dispersion outward. In this way we can see that the characteristics of a phenomena can be estimated by using information from surrounding areas.
I could give the example of my family members. My mother and father’s families both come from the same town in western Minnesota. Now many aunts, uncles and cousins no longer live in that town but still live in Minnesota, South Dakota or Wisconsin. Knowing the distance from "home" it is likely that we can predict the possibility I would have a family member living there. And it is true. There are only very few outliers like me who live as far away as California and Texas.
Of course this completely depends on how you define “close”. As with changing the scale of investigation in last week’s assignment, measurements of spatial autocorrelation change as you change the parameters in which you measure closeness. Another factor in this example would be city size. If you factor in distance from home and size of the city, I feel that you could closely predict the number of family members I have now living in a given area.
However the data that I presented above (then number of trees planted in Tanzania in 2008 by district) does not seem to be spatially correlated (with some exceptions). It’s true that as the way I define distance changes (only using absolute distance from the centroids of the districts and not using a k nearest neighbor), the Moran’s I test changes, but not significantly. I do find that the significant outliers of Iringa and Shinyanga to be interesting. Without knowing much about how the data was collected and what the numbers really mean, I do know that these are two of the districts that are known for their significant forest cover. Much more than that, I can not say.






No comments:
Post a Comment