# Contiguous Spatial Weight Matrix

## Introduction

There are a number of methods that have been developed to determine the closeness or nearness between locations.

Among the most straightforward of these is the contiguity weights matrix, which counts locations as “near” if they share a boundary with another such location (intuitively, this means that contiguity spatial weights matrices can only be used for polygon based datasets, which most AURIN datasets happen to be). While this is certainly more straightforward than some of the methods for determining spatial weights matrices, there are additional levels of complexity.

#### Queen or Rook Contiguity

There are two different means by which a location could be contiguous with its neighbours. If we determine that a location is contiguous with its neighbours if it shares a common line boundary, this is called Rook contiguity, much like a rook chess piece can move into other squares if they share a contiguous boundary. This is illustrated below for a mesh-block in Canberra (dark red): the mesh-blocks that have rook contiguity with the mesh-block in question are shown in light red. By contrast, if we determine that a location is contiguous with its neighbours if it shares a common vertex, this is called Queen contiguity, again like a queen chess piece can move into other squares if they share either a border or a corner. This is illustrated below for the same mesh-block in Canberra (dark blue): the mesh-blocks that have queen contiguity with the same mesh-block are shown in light blue.

[Click to Enlarge]

[Click to Enlarge]

#### Order of Contiguity

In addition to determining the extent to which contiguity is defined in a directional sense, we can also determine how far we consider a bordering polygon to be. This is known as the order of contiguity. The images above represent 1st order contiguity, where the immediately adjacent mesh-blocks (whether or rook or queen) appear within the spatial weights matrix as contiguous to the mesh-block in question. By comparison, 2nd order contiguity counts those polygons contiguous with the polygon in question (1st order contiguous polygons), as well as those contiguous with the 1st order polygons (whether by rook or queen contiguity).

The 2nd order contiguity representation of the Canberra mesh-blocks is illustrated below, where the lightest red or blue mesh-blocks represent the 2nd order contiguity mesh-blocks for the rook and queen contiguity methods, respectively.

[Click to Enlarge]

[Click to Enlarge]

## Inputs

To illustrate the Contiguous Spatial Weights Matrix in use, we will use socio-economic data for Perth

• Select Perth GCCSA as your area
• Spatialise your dataset, naming it something like SPATIALISED SEIFA IRSAD Perth

Once you have loaded and spatialised your dataset, navigate to the Contiguous Spatial Weights Matrix tool (Tools → Spatial Statistics → Contiguous Spatial Weights Matrix) and enter the parameters as shown below. These are also explained below the image

[Click to Enlarge]

• Dataset Input:   The dataset that you would like to calculate the spatial weights matrix – this must be spatialised in order for this tool to be run (either by spatialising an AURIN dataset with the spatialise tool, or by uploading a shapefile). Here we select SPATIALISED SEIFA IRSAD Perth
• Type:   This specifies whether you want a queen (ticked box – default) or rook (empty box) contiguity pattern. Here we tick to box to select Queen.
• Order:   This specifies how many orders of contiguity you would like (default: 1). Here we use the default of 1 order of contiguity.
• Style:   This specifies whether the standardisation will be binary, row-standardised (default) or globally-standardised. Here we select row-standardised
• Island Parameter:   This specifies how the matrix will deal with islands, which naturally have no contiguous neighbour. Here we tick to box to use the parameter

Once you have entered the parameters, click Add and Run to execute the tool

## Outputs

Once you have executed the tool, you should see an output appear in your Data panel. If you open this, you should see something like this:

[Click to Enlarge]

“0” scores within a cell indicate that the areas are not contiguous, and therefore do not affect each other. If a value is greater than zero, it indicates that the area specified by the column influences the area of the row by that much. It is important to realise that the values along the row will be identical – that is, each area that is contiguous with the target area influences it equally (even in 2nd or more order contiguity)

This spatial weights matrix can now be used for additional spatial statistical analysis, such as Moran’s I or Geary’s C.

## References

O’Sullivan, D. & D. Unwin. 2010. Geographic Information Analysis. Wiley and Sons