Data Management and Basic Mapping with GeoDa

advertisement
1
Data Management and Basic Mapping with GeoDa
Reinhold Kosfeld
Institute of Economics
University of Kassel
August 1, 2011
Contents
1.Introduction
2.GeoDa Main Menu and Toolbar
3. Opening a Project
4. Merging a Shape and Data File
Excursus
● Creating a Shape File
● Creating a dBase Data File
5. Creating Basic Choropleth Maps
6. Basic Table Operations and Linking
7. Creating a Contiguity Weights File
8. Weight Characteristics and Linking
2
1. Introduction
GeoDa is a collection software tools for spatial data analysis developed under the
lead of Luc Anselin (University of Illinois and Center of Spatially Integrated Social
Sciences) at the Center of Spatially Integrated Social Sciences (CSISS).
Geographical data must relate to discrete spatial units like regions, districts,
counties,or zip codes. This kind of data is usually termed lattice data. Actually,
GeoDa does not allow the analysis of geostatistical data (continuous surface data) or
point pattern data (locations of events).
GeoDaprovides a user-friendly and graphical interface to a variety of methods of
standard exploratory and spatial data analysis. For standard exploratory data
analysis (EDA), graphical devices like histograms, box plots and diverse types of
scatter plots are available. Descriptive spatial dataanalysis provides for example
measures of spatial autocorrelation and indicators of spatial outliers. Local measures
will usually be mapped for the whole study region.Advanced technical capabilities like
linking and brushing are implemented in GeoDa.
Inferential spatial analysis is in particular involved with spatial autocorrelation and
regression analysis. For different purposes it will be of advantage to map local pvalues or regression residuals can also be mapped for the system of regions.In the
present version of GeoDA,OpenGeoDa 0.9.9.12, regression analysis can be
accomplished for a cross-section of regions. Up to now, GeoDa is not geared to
analysing spatial panels.
GeoDa can be downloaded at no charge from the GeoDa Center website
http://geodacenter.asu.edu/software/downloads. All the user has to do is to register.
Once a user account is created, the software can be downloaded. Tutorials and other
materials related to GeoDa are available on http://geodacenter.asu.edu/learning/
tutorials. A comprehensive survey on GeoDa is covered by the webbook “Exploring
Spatial Data with GeoDa: A Workbook”byAnselin.
This tutorial deals with different types of files necessary for mapping and spatial data
analysis with GeoDa:
-
input data file,
polygon shape file,
weight file.
The management of these files in GeoDa is illustrated by examples from applied
research of the author in the field of regional economics.
3
2.GeoDa Main Menu and Toolbar
Start GeoDa by double-clicking on the GeoDa icon
on the desktop or choosing
GeoDa from the list of programs displayed after clicking on the start icon.
The Main Menu provides utilities for data management and techniques for mapping
and non-spatial and spatial statistical analysis under the menu items Map, Explore,
Space and Method. Most of the functions can also be invoked by the toolbar buttons.
Figure 2.1: GeoDa main menu and toolbar
From the Map menu, for example, quantile and box maps are available. Likewise
different types of rate maps as special cases of choropleth maps can be constructed
(Figure 2.2).Note that all items greyed out which means that the methods are not
available without further ado.
Figure 2.2: Map menu
These mapping facilities can also be invoked by clicking on the Maps and Smoothing
button in the toolbar (Figure 2.3). Without defining a project, no list of methods is
visible.
4
Figure 2.3: Maps and Smoothing toolbar button
The Explore menu provides methods of exploratory data analysis (EDA) like the
histogram, scatter plot and box plot (Figure 2.4).Toolbar buttons are available for
each of the EDA techniques.
Figure 2.4: Explore menu
Spatial autocorrelation analysis can be invoked by the Space Menu (Figure 2.5). The
global and local Moran coefficient is as well available as local Getis-Ord statistics (G
statistics). All spatial autocorrelation coefficients and testscan be also called up by
toolbar buttons.
Figure 2.5: Space menu
The Methods Menu involves standard least-squares and spatial regression models.
Regression analysis with GeoDa also involves several tests on coefficients and
residuals. In particular tests on spatial autocorrelation of the disturbances are
accomplished. Regression analysis cannot be invoked from the toolbar.
5
Figure 2.6: Methods menu
While the Table menu provides facilities for managing tables and performing table
calculations, the Tools menu especially contains capabilities for creating spatial
weights, creating and converting shape files and exporting data.
The items of Options menu depend on the chosen technique of data analysis.
Currently the Help menu only gives information on the GeoDa Center and the current
version of GeoDa.
All items greyed out in the submenus require a project to be defined in the first place.
A project consists of a shape file covering geographical information on a system of
regions that is usually extended by data from a special field of application.In the next
section we will consider, how a project is opened from the File Menu or the Open
Project toolbar button.
3. Opening a Shape File
You ordinarily start data analysis with GeoDa by opening a project from the File
menu(Figure 3.1) or clicking on the Open Project button of the toolbar (Figure 3.2).
Figure 3.1: Open Shape File from the File menu
Figure 3.2: Open Project from toolbar
6
In either case the window Choose a Shape file to open window appears (Figure 3.3).
Select the shape file DKR439.shp that contains geographical information of all 439
German districts.
Figure 3.3: Choose a Shape File to open window
.
.
After clicking on the Open button, a blank map will appear showing all 439 districts of
Germany on the right hand side. On the left hand side you find the legend pane.
Figure 3.4: Blank map of German districts1
Both panes can be resized by dragging the separator between them. The settings
can be changed by right clicking in the map window. In the right pane a different
colour can be selected from a palette of colours e.g. for the map, the background or
highlighting regions. There is also the possibility to change the shape of the selection
1
© EuroGeographics for the administrative boundaries.
7
tool. By right clicking in the left pane another background colour for the legend can
be selected.
Exercises
3.1 Resize the legend pane so that the complete file name is readable.
3.2 Display the map of the German districts in red colour.
3.3 Choose the colour yellow for the background of the map pane.
3.4 Choose grey as the colour for the background of the legend pane.
3.5 Portray only the isle of Rugia in the map pane.
4. Merging a Shape and Data File
When a shape file is loaded, the complete main menu and toolbar is active. At the
start the shape usually only contains geographical information with an identifier for
the regions. For spatial data analysis, this information must be combined with
datafrom the field of application. The data must be available in a dBase file (.dbf file).
We will merge employment data set Besch06EKr with the shape file DKR439.shp of
the 439 German districts. This data set contains sectoral employment figures at the
district level for research and development (R&D) intensive industries and the entire
manufacturing industry. Additionally. Population figures are included:
DG24: Chemical Industry
DK29: Manufacture of machinery and equipment
DL: Manufacture of electrical and optical instruments
DL30: Manufacture of office machinery and computers
DL31:Manufacture of electrical machinery and apparatus
DL32:Manufacture of radio, television and communication equipments and
apparatus
DL33:Manufacture of medical, precision and optical instruments, watches and
clocks
DM34: Manufacture of motor vehicles, trailers and semi-trailers
D_VG: Manufacturing Industry
EINW: Population
Load the shape file DKR439.shp. Open the Table Menu and click on Merge Table
Data (Figure 4.1).
8
Figure 4.1: Merge Table Data from the Table menu
A table with the geographical variables for the 439 German district (Figure 4.2)
appears along with the Merge Table Data window (Figure 4.3). The table associated
with the shape file consists of geographical variables:
- SP_ID (district identifier),
- NUTS_ID (NUTS identifier),
- SHAPE_LENG (average district length)
- SHAPE_AREA (district area)
- KREISCODE (official district code (identical with SP_ID)
- NAME (district name)
- ZUORDNUNG (rural or urban district, federal city state).
The variables AREA an LEN are set equal to zero. The values of the area and length
of the districts are listed in SHAPE_AREA and SHAPE_LENG.
Figure 4.2: Table with Geographical Variables from the Shape File DKR439.shp
9
Navigate in the familiar window structure of the Merge Table Data window until the
input file Besch06EKr.dbf is located (Figure 4.3). The Key is an identifier variable that
must be present in both the shape and data file to uniquely match the spatial units.
Leave the Key to its default KREISCODE.
Figure 4.3: Merge Table Data window
Select the variables of the variables to be included in the shape file. First, click on the
upper double arrow button (>>)to include all variables. Next mark the variable
KREISCODE and click on the upper single arrow button (<).
Figure 4.4: Select variables in the Merge Table Data window
10
The Key variable need not twice be included in the new shape file. Now click on the
Merge button to join both files. Figure 4.5 displays the joint table with combined
geographical information and sectoral employment data for the 439 German districts.
Figure 4.5: Joint table after Merging Table Data of the shape file DKR439.shp and
data file Besch06EKr.dbf
Before storing the extended shape file permanently, the redundant variables AREA
and LEN should be deleted. For this, invoke the Table function from the main menu
and select the item Delete Column (Figure 4.6).
Figure 4.6: Delete Column from Table menu
The Remove Column window appears (Figure 4.7). Choose the variable AREA from
the pull-down menu in the field Pick the column name and click on the Delete button:
11
Figure 4.7: Remove Column window
The variable AREA is removed from the table. Delete the variable LEN in the same
way.
Now open the Table Menu again to store the extended shape file permanently.
Choose Save as New Shape File … from the Table menu (Figure 4.8):
Figure 4.8: Save as New Shape File … from the Table menu
The Output Shp file window appears in the familiar Windows dialog. Change the
displayed file name to DKR439Besch06E.shp. Finally, store the new shape file by
clicking the Store button:
Figure 4.9: Storing the extended Shape file DKR439Besch06E.shp
12
The new shape file DKR439Besch06E.shp with sectoral employment data is now
available for data analyses and mapping with GeoDa.
Excursus
● Creating a Shape File
Technically, a map of a system of adjacent regions can be viewed as an irregular
lattice. In order to map the boundaries of the regions in GeoDa, a polygon shape file
is required. The shape file will be created by GeoDa from a text file that contains
polygon boundary coordinates. Figure E4.1 shows the structure of the input text file
DKR439.txt from which the shape file DKR439.shp for the German districts
couldprincipally be created.2
Figure E4.1: Text file with coordinates of the boundaries of the German districts
The header line contains the number of districts followed by polygon identifier (=
region identifier). Both figures are separated by a comma. On the following lines, the
2
Here we used a completed shape file of German districts from EUROSTAT.
13
polygons (= regions) are geographically defined. The first line for each polygon
contains consists of the identifier and the number of points, separated by a comma.
The latter are defined by coordinate pairs that are listed in the following lines.In the
case of the German districts we make use of the latitude and longitude coordinates3
● Creating a dBase File
In GeoDa, data is read from a dBase file format (DBF file format). Since data is often
stored in spreadsheet files (.xlsx files), these files have to be converted in a DBF
format. This could be done by special conversion programs. Alternatively, one can
use the open source software R for mathematical and statistical computing and
programming which is free available on the homepage of the R project http://www.rproject.org.
Assume that the data is available in the Excel spreadsheet file Besch06EKr.xlsx.
Open the file Besch06EKr.xlsx (Figure E4.2).
Figure E4.2: Employment data in the Excel file Besch06EKr.xlsx
Store it in Excel as a CSV file (text file with comma separated values)
Besch06EKr.csv.
3
For illustrative examples, polygons can be defined by arbitrary x and y coordinates.
14
Figure 4.3: Windows dialog for saving data in CSV format in Excel
At last run the following commands in R to create the DBF file Besch06Kr.dbf:
>library(foreign)
> Besch06EKr = read.csv2(file="Besch06EKr.csv")
>write.dbf(Besch06EKr,file="Besch06EKr.dbf")
Exercises
Five regions are arranged in the following form:
1
2
4
3
5
The x and y coordinates of the regions are given as follows:
Region 1: 3.0,6.0; 8.0,6.0; 8.0,4.0; 5.0,4.0; 3.0,4.0
Region 2:8.0,6.0; 11.0,6.0; 11.0,5.0; 11.0,4.0; 8.0,4.0
Region 3:5.0,4.0; 8.0,4.0; 11.0,4.0; 11.0,3.0; 11.0,2.0; 5.0,2.0
Region 4:11.0,5.0; 15.0,5.0; 15.0,3.0; 11.0,3.0; 11.0,4.0
Region 5:15.0,5.0; 17.0,5.0; 17.0,3.0; 15.0,3.0
15
Regional data is available on the unemployment rate (u) and the vacancy rate (v):
Region
1
2
3
4
5
u
6
8
8
11
12
v
3
3
2
1
1
4.1 Create a shape file region5_ppt.shp for the five adjacent regions!
4.2 Create a dBase file region5_uvdata.dbf with a matching identifier!
4.3 Merge the shape file region5_ppt with the dBase file region5_uvdata and store
the extended shape file under the name region5uv.shp!
5.CreatingBasic Choropleth Maps
Open the shape file DKR439Besch06E.shp by selecting
File > Open Shape File …
from the GeoDa menu. In this exercise, we wish to examine the spatial distribution of
employees in R&D industries and the manufacturing industry as a whole with the aid
of the GeoDa mapping possibilities.
Figure 5.1 display different types of choropleth maps available under the Map menu
in GeoDa. Choose the item Quantile as the simplest type of a choropleth map.
Figure 5.1: Selecting the Quantile map from the main menu
16
The Variable Settings dialog requests the choice of a variable for mapping. Select
D_VG in the field 1st Variable (X) for mapping the employees in the manufacturing
sector (Figure 5.2). The field 2nd Variable (Y) is not needed for Quantile map. You
could check the box Set the variables a default, if you intend to use the same
variable in repeated analyses. Leave the box unchecked and click OK.
Figure 5.2: Variable Settings for Quantile map
At last you are asked for the number of classes (Figure 5.3). With the default number
of 4 classes a quartile map is created.
Figure 5.3: Number of classes for Quantile map
After clicking OK, a quartile map for the employees in the manufacturing industry is
created. Drag the separator in the map window to the right to make the full legend
visible. Figure 5.3 shows the quartile map of the variable D_VG with a legend. The
legend first names the variable D_VG followed by the colours used in the map for the
classes. The classes are represented by intervals followed by frequencies in
parentheses. Each class involves approximately 110 observations.
17
Figure 5.3: Quartile map of employees in manufacturing industry
In order to focus the attention on outliers in the spatial distribution of a georeferenced variable, GeoDa provides specialized maps like the Percentile and Box
map. At first take a look at the Percentile map that sorts the regions in classes of
relative frequencies of < 1%, 1 – 10%, 10 – 50%, 50 – 90%, 90 – 99% and > 99%. A
Percentile map is invoked by selecting
Map > Percentile
in the GeoDa menu or clicking on the Maps and Smoothing button and choosing
Percentilefrom the toolbar. The same Variable Settings dialog as for the Quantile
map appears. After selecting the variable D_VG and clicking OK, GeoDa displays the
Figure 5.4: Percentile map of employees in manufacturing industry
18
corresponding Percentile map. Drag the separator between the two panes so that the
legend is fully in view. Potential outliers at the lower tail of the distribution are
coloured in dark blue and those at the upper tail in dark red. Figure 5.4 points to four
(five) potential outlying regions with low (high) employment figures.
Another outlier map is the Box map. This is essentially a quartile map extended by an
outlier identification rule. Outliers are regions with values that are more than 1.5 or
3.0 times the quartile range apart from the 1st or 3rd quartile of the mapped variable.
Select Box Map from the Map menu with a hinge of 1.5 (Figure 5.4) or click on the
Maps and Smoothing button and choose Hinge = 1.5.
Figure 5.4: Selecting the Box Map from the main menu
Figure 5.5: Selecting the Box Map form the toolbar
This opens a familiar Variable Settings dialog familiar from the Quantile and
Percentile map. Select again the variable D_VG and click OK.The resulting Box map
is shown in Figure 5.6.
19
Figure 5.6: Box Map of employees in manufacturing industry
As in the Percentile map, lower (upper) outliers are coloured in dark blue (dark red).
Note that none of the potential outlying regions in the lower tail of the distribution of
the employees in the manufacturing industry identified by the Percentile map are
confirmed as outliers according to the identification rule (Hinge = 1.5) use in the Box
map. On the other hand, it seems to be strange that the Box map identifies 33 upper
outliers.
Such problems often come along with so-called extensive variables that are not
related to the “sizes” (area, population, etc.) of the regions. For choropleth mapping
the use of intensive variables like rates and densities is usually more appropriate. In
the next section we show how such kind of variables can be calculated in GeoDa.
Exercises
5.1 Create a quartile and a quintile map for the number of persons employed in the
electrical and optical industry (DL)! Interpret the maps!
5.2 Create a Percentile map for the variable DL! Which problem occurs when
constructing this map?
5.3 Create Box maps for hinges of 1.5 and 3.0 for the variable DL! Compare the Box
maps with each other!
5.4 In what way does a Percentile map differ from a Box map? Explain the absence
of lower outliers with both the Percentile and Box map!
20
6.Basic Table Operations and Linking
In GeoDa, the project with the shape file DKR439Besch06E.shp is already opened.
Create once again the Percentile map
Map>Percentile
for the variable D_VG. Click on the Open Table button in the toolbar (Figure 6.1).
Figure 6.1: Open Table button of the toolbar
In Figure 6.2, an excerpts of the table associated with the project DKR439Besch06E
is shown.
Figure 6.2: Table from dBase file DKR439Besch06E.dbf
…
In order to identify the four potential upper outliers in the Percentile map, press
SHIFT-CTRL and select the regions coloured in dark red by clicking on them. The
selected regions are marked by a cross-hatch pattern (Figure 6.3). By right-clicking
on the map or invoking theOptions menu you can change the colour of the crosshatch:
Options > Color > Highlight Color.
21
Figure 6.3: Cross-hatched upper outlying regions in the Percentile map
The selected districts are highlighted gray in the table (Figure 6.4). This feature is
called “linking”. It does not only pertain to tables but also to all map and other graphs
in GeoDa.
Figure 6.4: Selected districts in the linked table
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
22
From Figure 6.4, the district names of the potential outlying regions are visible:
Wolfsburg (3103)with 54733 D_VG employees, Märkischer Kreis (5962) with 64961
D_VG employees, Berlin (11000) with 103866 D_VG employees, Hamburg
(2000)with 66334 D_VG employees, und Stuttgart (8111)with 71777 D_VG
employees.
Right click on the table or select the Table menu to move the upper potential outliers
to the top:
Table > Move Selected to Top
Figure 6.5: Selected districts at the top of the linked table
Clear the selection by clicking anywhere outside the map or choosing the Table
menu:
Table > Clear Selection
You restore the original order of the observations in the table by double clicking on
the header of left-most column with the sequence numbers.
We have already seen how the table can be changed by deleting columns i.e.
variables. The GeoDa table functionality also allows for adding new columns and
transforming current variables. In regional economics, concentration of industries and
specialisation of regions are often measured in relation to overall manufacturing
activity. With this intention, we wish to analyse the spatial distribution of the
sharenumber of persons employed by industry.
Select the item Add Column in the Table menu (Figure 6.6) or by right-clicking on the
table.
23
Figure 6.6: Add Column from Table menu
This opens an Add Column dialog box with three fields (Figure 6.7). Enter DL_VG for
the new column (new variable) in the Name field. Accept the default float in the Type
field and choose EINW in the After field.
Figure 6.7: Add Column dialog box
After clicking on Add a new column with the header ANTDL is added right next to the
EINW column. Next select Field Calculation from the Table menu (Figure 6.8) or by
right-clicking on the table.
Figure 6.8: Select Field Calculation from the Table menu
24
At the start the Filed Calculation with a dialog for Unary Operations i.e. operations
with only one operand appears. Note the change of the dialog when clicking on the
Binary Operations tab. Select ANTDL as the Result variable from the scroll-down
menu on the left-hand side of the equation. Specify the division of Variable 1 DL by
Variable 2 D_VG on the right-hand side as shown in Figure 6.9.
Figure 6.9: Field Calculation window
By clicking on Apply the zero entries in the ANTDL column are replaced shares
employed persons between zero and one (Figure 6.10).
Figure 6.10: Calculated shares of employed persons in column ANTDL
25
….
Using the new intensive variable ANTDL we wish to identify potential upper outliers
with regard to manufacture of electrical and optical instrument. Select
Map > Percentile
from the main menu and choose ANTDL in the Variable Settings dialog as the 1st
Variable. Ignore the warning regarding the uniquely sorting of records break points,
as this only pertains to the lower tail of the distribution. Click on the 5 red coloured
areas in the Percentile map. Figure 6.11 exhibits the location the five selected
districts with a cross-hatch pattern.
Figure 6.11: Potential upper outliers in Percentile map
Click on the Open Table button in the toolbar and select
Table > Move Selected to Top
26
to identify the districts with a high share of employees manufacture of electrical and
optical instruments. According to linking, these districts are highlighted in grey in
Figure 6.12.
Figure 6.12: Potential upper ANTDL outliers in linked table
…
In order to verify whether these districts are outliers according to the HINGE = 3.0
identification rule, select
Map > Box Map > Hinge = 3.0
in the GeoDa main menu. Choose ANTDL in the Variable Settings dialog and click
OK. Mark the red coloured areas. The four upper outlying regions are evidenced by a
cross-hatch in Figure 6.12.
Figure 6.12: Outlying districts in Box Map with Hinge = 3.0
27
In Figure 6.13 the four outlying regions are place at the top of the table.
Figure 6.13: Upper ANTDL outliers (Hinge = 3.0) in linked table
…
The identification rule (Hinge = 3.0) confirmed the districts Greifswald, Freiburg,
Munich and Jena as upper outlying regions with regard to manufacture of electrical
and optical instruments (DL industry). Their employment shares for this industry are
more than 3 times quartile range away from the 3rd quartile. By contrast, the potential
outlier Karlsruhe does not prove to be an outlier according to the applied
identification rule with respect to the DL employment share.
Exercises
28
6.1 Add two new columns ANTED_VG and ANTFD_VG to the table and calculate the
rate and density of total employment in the manufacturing industry!
6.2 Create Percentile maps for the variables ANTED_VG and ANTFD_VGand locate
the upper potential outliers!
6.3 Identify the selected districts in the linked tables of the Percentile maps created in
exercise 6.2!
6.4 Create Box Maps with Hinge = 3.0 for the variables ANTED_VG and ANTFD_VG
and locate the outlying areas!
6.5 Identify the selected districts in the linked tables of the Box Maps created in
exercise 6.4!
7. Creating a Contiguity Weight File
In GeoDa spatial weights can be constructed for a shape file that contains
information on the contiguity structure and distances between regional centres. This
information allows for creating both contiguity- and distance-based spatial weights.
However, distances can actually only be used for defining regional neighbourhoods.
Open the data shape file DKR439.shp with the variable KREISCODE as the key.
Select
Tools > Weights > Create
from the main menu (Figure 7.1)or click on the Weights Create button in the toolbar
(Figure 7.2).
Figure 7.1: Weights creation from Tools menu
Figure 7.2: Weights creation from toolbar
29
A Weights File Creating dialogwith several options appears. Specify DKR439 as the
Input Shape File and choose KREISCODE as the Weights File ID Variable from the
underlying scroll-down menu in the upper part of the window.
Next, the type of spatial weights has to be specified. As we opt for contiguity-based
weights, the field Distance Weight need not be considered. The field Contiguity
Weight offers the choice between Queen or Rook Contiguity as well as different
orders of contiguity. Check the radio button to the left of Rook Contiguity to define the
neighbourhood between regions by common borders. Accept the default value of one
for the 1st order of contiguity and click create.
Figure 7.3: Weights File Creation
This brings upthe Choose an output weights file name dialog(Figure 7.4).
Figure 7.4: Choose an output weights file name
30
SelectDKR439 as the name for the spatial weights file. The GAL format of the
weights file allows editingit with any text editorlike a simple text file (.txt). After storing
the GAL file, the message ‘Weights file “DKR439.gal’ successfully created” appears.
Click OK and Close the Weights File Creation window.
The structure of the GAL file appears in Figure 7.5. The header line contains a
placeholder (0), the number of regions (439), the name of the shape file (DKR439)
Figure 7.4: Structure of GAL weights file
and the name of the ID variable (KREISCODE). The other lines include regionspecific information. For each region two lines are reserved. While the first one
31
contains the region codes and the number of neighbours, the second one gives the
region codes for the neighbours.
Exercises
7.1 Create contiguity-based weights of order 1 for the shape file region5_ppt.shp on
the basis of the rook criterion!
7.2 Edit the created GAL file region5_ppt.gal and interpret the contents!
7.3 Create contiguity-based weights of order 2 for the shape file region5_ppt.shp on
the basis of the rook criterion! Interpret the contents of the created GAL file
region5_ppt2.gal!
8. Weight Characteristics and Linking
Before using the weights in spatial data analysis, they should be checked for their
characteristics. Special attention should be drawn to undesirable features such as
unconnected regions (“islands”). This can be done by examining the frequency
distribution of the number of neighbours.
In GeoDa, this distribution is displayed in form of a histogram that is generated by
selecting
Tools > Weights> Properties
in the main menu (Figure 8.1) or clicking on the Weights neighbor histogrambutton in
the toolbar (Figure 8.2).
Figure 8.1: Weights Properties from the Tools menu
Figure 8.2: Weights neighbors histogram from toolbar
32
This opens the WEIGHT CHARACTERISTICS box where the weight file has to be
specified. Navigate in the working directory for the weight file DKR439.gal and click
OK (Figure 8.3).
Figure 8.3: Open weight file in the WEIGHT CHARACTERISTIC box
The histogram of the number of neighbours is depicted in Figure 8.5. The height of
the bars reflect the numbers of regions with 0, 1, …, 12 neighbours. The range of the
number of neighboursis shown together with the absolute frequencies (in
parentheses) in the legend. One region is unconnected i.e. is an “island”, whereas
one other region has the maximum number of 12 neighbours.
Figure 8.4: Histogram of number of neighbours with one “island”
33
The unconnected region is the isle of Rugia with the region code (KREISCODE)
13061. Although the isle of Rugia is an unconnectedregion in the map, it is actually
connected by a bridge with the city of Stralsund (region code 13005).
This information has to be included in the weights file (.gal) manually. The isle of
Rugia has one and the city of Stralsund two neighbours. Update the weights file
manually as in Figure 8.5 and store the changes in the GAL file DKR439NI.gal.
Figure 8.5: Manually updated weights file
……………………….
Figure 8.6 shows the histogram of the number of neighbours for the updated weights
file DKR439NI.gal.
Figure 8.4: Histogram of number of neighbours without “islands”
34
The linking applies not only to maps and tables, but also to statistical graphs like
histograms. If you want to know where the two districts with 11 neighbours are
located, click on the second right most bar in the histogram. Figure 8.5 depicts that
the selected bar turns to yellow.
Figure 8.5: Selection of the second right most bar in the histogram
Because of linking, the location of the two districts with 11 neighbours can be seen in
the map (Figure 8.6).
Figure 8.6: Districts with 11 neighbours in linked map
35
Figure 8.7 shows that the districts in question are Bayreuth and Mettmann.
Figure 8.7: Districts with 11 neighbours in the linked table
Exercises
8.1 Check the weight properties for the weights file region5_ppt.gal!
8.2 Select the right most bar in the histogram for the weights file region5_ppt.gal and
interpret the linked map and table!
8.2 Select the left most bar in the histogram for the weights file region5_ppt.gal and
interpret the linked map and table!
Download