Beginning in SAS 9.2, Moran's I and Geary's c coefficients are available with the experimental AUTOCORRELATION option in the COMPUTE statement of PROC VARIOGRAM in SAS/STAT software. See the description of this option in the PROC VARIOGRAM documentation.
When you specify the AUTOCORRELATION option with no suboptions, PROC VARIOGRAM computes both Moran's I and Geary's c with p-values determined under the normality assumption with binary weights. The definitions of these two measures of autocorrelation and descriptions of the various assumptions and weights available can be found in "Autocorrelation Statistics" in the Details section of the PROC VARIOGRAM documentation.
PROC VARIOGRAM reports the two-sided p-values for Moran's I and Geary's c coefficients under the null hypothesis that the sample values are not autocorrelated. Smaller p-values correspond to stronger autocorrelation for both coefficients. However, the p-values do not tell you whether the autocorrelation is positive or negative. Positive autocorrelation is indicated when the Z score for Moran's I is positive (ZI>0) or the Z score for Geary's c is negative (Zc<0). Negative autocorrelation is indicated when ZI<0 or Zc>0.
The following example demonstrates computing Moran's I and Geary's c statistics for a spatial data set. The data set used in this example, daGSIdata, contains 96 observations of global solar irradiance daily averages for a 300 kilometer square region (Kolovos, 2010). The location of each observation is expressed in the corresponding Easting and Northing coordinates. The variable daGSI contains the observed value at each location.
The following statements create the daGSIdata data set and display the first five observations.
data daGSIdata; input Easting Northing daGSI @@; datalines; 13.6 33.4 17.4906 116.6 40.9 17.9709 86.0 215.3 17.0232 248.1 266.9 18.8413 40.2 149.3 17.6422 249.9 219.5 18.4011 298.6 19.8 18.3800 161.6 262.3 18.6537 165.9 204.9 18.8376 236.3 249.9 18.2338 141.5 108.1 18.3977 253.0 156.4 18.8378 218.6 81.2 18.6493 46.5 77.8 17.7590 292.8 47.7 18.5304 83.0 164.0 17.7159 110.8 225.6 17.9139 202.9 189.1 18.7072 199.5 17.5 18.8718 103.7 158.7 17.9594 184.7 252.5 18.6570 76.0 200.3 16.9481 51.5 35.6 17.7746 158.1 220.3 18.4775 230.9 55.0 18.9772 158.5 226.4 18.3128 252.8 131.5 18.6633 61.2 20.6 17.8255 279.6 212.6 19.0338 294.1 42.3 18.6408 80.9 82.3 17.6355 124.8 253.5 18.3031 18.0 286.4 17.7586 229.7 154.7 18.5950 71.8 47.0 17.9481 280.9 210.9 19.1626 92.9 125.8 17.6257 28.6 275.5 17.5359 186.4 111.7 18.5684 16.1 167.7 17.8476 114.9 130.2 17.7519 140.7 272.4 18.1968 122.5 155.3 17.7771 63.8 259.7 17.4883 262.1 12.3 18.5385 257.6 262.2 18.9482 128.8 229.1 17.9638 269.8 15.9 18.4247 288.6 236.9 18.6137 124.5 130.2 17.9114 7.3 117.2 17.3567 153.0 299.9 18.0288 75.8 85.2 17.5313 67.9 247.3 17.6824 81.7 199.0 17.2191 275.3 260.2 18.9168 180.6 39.6 18.6395 28.8 10.3 17.6430 217.2 76.1 18.7481 282.4 95.2 18.0833 143.0 196.7 18.5825 42.0 245.1 17.2660 179.1 187.1 18.6990 41.3 134.6 17.5906 217.0 130.8 18.6883 166.1 152.1 18.5032 186.4 59.2 18.9922 264.9 294.8 18.3716 228.6 42.1 18.7740 214.1 38.5 19.0145 123.5 66.2 18.5217 26.3 20.4 17.4753 39.7 78.8 17.6835 113.8 247.1 18.0232 225.0 63.3 18.8826 242.4 29.8 19.0110 260.5 158.1 18.7582 297.8 270.0 19.0336 111.8 90.1 18.2008 79.6 43.7 17.7467 102.8 90.7 18.0879 51.1 184.0 17.4158 216.3 85.0 18.7803 11.7 261.0 17.5346 291.6 265.7 19.2310 119.8 125.1 17.7093 127.4 176.8 18.1153 152.7 74.3 18.5789 202.1 70.3 18.7343 67.7 218.1 17.0247 138.5 38.3 17.8701 72.9 163.9 17.6970 189.7 144.7 18.4584 144.3 121.6 18.3561 120.7 246.9 18.0552 216.6 22.4 19.3410 ; proc print data=daGSIdata(obs=5) noobs; run;
|
The next statements use PROC VARIOGRAM to calculate Moran's I and Geary's c coefficients by specifying the AUTOCORRELATION option in the COMPUTE statement. You can optionally specify the WEIGHTS= suboption to select the method for computing autocorrelation weights. In the COORDINATES statement provide the names of the variables containing the X and Y coordinates. Finally, in the VAR statement specify the analysis variable you are interested in testing for spatial autocorrelation. In this example, the daGSI variable is tested for autocorrelation.
proc variogram data=daGSIdata; compute novar autocorrelation(weights=distance); coordinates xc=easting yc=northing; var dagsi; run;
The resulting Autocorrelation Statistics table containing Moran's I and Geary's c coefficients is shown below. Based on the p-values of the reported Moran's I and Geary's c coefficients, you can reject the null hypothesis of zero spatial autocorrelation in the values of daGSI. Furthermore, the Z scores indicate positive autocorrelation.
|
The distance matrix used in the above calculations is a 96×96 matrix where each off-diagonal entry (i,j) in the matrix is equal to 1/(1+h), where h is the distance between point i and point j. Note that this is just one of many different ways to calculate an inverse distance matrix. In general, you can define distance weights as s/(1+hp), where the nonnegative parameters s and p can be specified, respectively, in the SCALE= and POWER= suboptions of the WEIGHTS=DISTANCE suboption. You can also use binary weights if there exists some threshold distance, d, such that pairs with distances less than d are considered "connected" or "close" and pairs with distances greater than d are not. This is done in the COMPUTE statement using the WEIGHTS=BINARY suboption and the LAGDISTANCE= option. The statements below specify binary weights with a threshold distance of 15.
proc variogram data=daGSIdata; compute novar lagdistance=15 autocorrelation(weights=binary); coordinates xc=easting yc=northing; var dagsi; run;
Below is the resulting Autocorrelation Statistics table. The change in distance measure does not change the interpretation from the previous analysis. Based on the p-value of the reported Moran's I and Geary's c coefficients, you can reject the null hypothesis of zero spatial autocorrelation in the values of daGSI. The Z scores again indicates a positive autocorrelation.
|
Additional options allow you to define the weight matrix with asymmetric row-averaged weights, or to use normalized distance weights. See the PROC VARIOGRAM documentation for details.
_____
Kolovos, A. (2010), "Everything in its Place: Efficient Geostatistical Analysis with SAS/STAT Spatial Procedures," Proceedings of the SAS Global Forum 2010 Conference, Cary, NC: SAS Institute Inc.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | SAS/STAT | All | n/a |
Type: | Usage Note |
Priority: | low |
Topic: | Analytics ==> Spatial Analysis SAS Reference ==> Procedures ==> VARIOGRAM |
Date Modified: | 2010-11-09 11:11:34 |
Date Created: | 2002-12-16 10:56:40 |