Spatially Lagged Variables

Exercise 17 Spatially Lagged Variables

17.1 Objectives

This exercise illustrates the construction of a spatially lagged variable and its use in a Moran scatter plot.

At the end of the exercise, you should know how to: • create a spatially lagged variable for a specified weights file • use the spatial lag to construct a Moran scatter plot “by hand”

More detailed information on these operations can be found in the User’s Guide , pp. 61–62.

17.2 Spatial Lag Construction

Spatially lagged variables are an essential part of the computation of spa- tial autocorrelation tests and the specification of spatial regression models. GeoDa typically computes these variables on the fly, but in some instances it may be useful to calculate the spatially lagged variables explicitly. For example, this is handy if one wants to use these variables in other statistical packages.

The spatial lag computation is part of the Table functionality in GeoDa (see Exercise 3, and especially Section 3.4 on p. 17). Begin by loading the sample data shape file for the 403 census tracts in Sacramento, CA (use sacramentot2.shp with POLYID as the Key). The base map should be as in Figure 15.1 on p. 107.

Figure 17.1: Open spatial weights file.

Figure 17.2: Select spatial weights file.

Before starting the Table operations, make sure that a spatial weights file has been opened. If no such file is present, the spatial lag computation will generate an error message. Open the weights from the menu, using Tools > Weights > Open , as in Figure 17.1, or by clicking on the matching toolbar button. Specify sacrook.GAL as the file name in the weights dialog, as shown in Figure 17.2.

Everything should now be in place to start the lag computation. Open the data table (click on the Table toolbar button) and right click to select Field Calculation from the menu (Figure 17.3 on p. 126). Next, select the Lag Operations tab in the Field Calculation dialog, as in Figure 17.4 (p. 126). Overwrite the entry in the left most text box with W INC, as in Figure 17.5 (p. 126), leave the weights file to the default, and select HH INC (census tract median household income) as the variable to be lagged. Click on OK to compute the new variable. It will be added to the data table in a new column, as illustrated in Figure 17.6 on p. 127.

Recall from Figure 15.7 (p. 110) that the tract with POLYID 2 had four neighbors. The relevant tracts are highlighted in the map and table of Figure 17.6.

For a contiguity weights file, such as sacrook.GAL, the spatially lagged variable amounts to a simple average of the values for the neighboring units.

Figure 17.3: Table field calculation option.

Figure 17.4: Spatial lag calculation option tab in table.

Figure 17.5: Spatial lag dialog for Sacramento tract household income.

Figure 17.6: Spatial lag variable added to data table.

Check in Figure 17.6 how the value for W INC in row 2 (50164) is the average of the values of HH INC in rows 1, 3, 4 and 6.

17.3 Spatial Autocorrelation

A Moran scatter plot is a plot with the variable of interest on the x-axis and the spatial lag on the y-axis (for details, see Section 18.2.2 on p. 131). Since the just computed spatial lag is immediately available for any analysis, you can now “manually” construct a Moran scatter plot using W INC for the spatial lag and HH INC for the variable on the x-axis in a regular scatter plot (see Section 8.2 on p. 53).

Start the scatter plot function as Explore > Scatter plot from the menu or by clicking the matching toolbar button. In the variable selection dialog, specify W INC in the left side column and HH INC in the right side column, as in Figure 17.7 on p. 128. Next, click OK to generate the plot shown in Figure 17.8 on p. 128.

The slope of the regression line (0.5632) is the Moran’s I statistic for HH INC , using a rook contiguity weights definition. Feel free to run ahead and follow the instructions in Section 18.2.2 (but with the relevant Sacramento data and weights substituded) to check that this is indeed the case. Of course, since Figure 17.8 is a non-spatial scatter plot, it does not contain any means to assess the significance of the Moran’s I.

Figure 17.7: Variable selection of spatial lag of income and income.

Figure 17.8: Moran scatter plot constructed as a regular scatter plot.

17.4 Practice

Use any of the spatial weights constructed as part of Exercises 15 or 16 to create spatially lagged variables and construct a Moran scatter plot by hand.