The table in GeoDa includes some limited “calculator” functionality, so that new variables can be added, current variables deleted, transformations carried out on current variables, etc. You invoke the calculator from the drop down menu (right click on the table) by selectingField Calculation (see Figure 3.2 on p. 14). Alternatively, selectField Calculationfrom the Tableitem on the main menu.
The calculator dialog has tabs on the top to select the type of operation you want to carry out. For example, in Figure 3.7 on p. 18, the right-most tab is selected to carry out rate operations.
Before proceeding with the calculations, you typically want to create a new variable. This is invoked from the Table menu with the Add Column command (or, alternatively, by right clicking on the table). Note that this is not a requirement, and you may type in a new variable name directly in the left most text box of the Field Calculation dialog (see Figure 3.7). The new field will be added to the table.
You may have noticed that thesids.shpfile contains only the counts of births and deaths, but no rates.2 To create a new variable for the SIDS death rate in 74, selectAdd Columnfrom the drop down menu, and enter SIDR74
2
Figure 3.7: Rate calculation tab.
Figure 3.8: Adding a new variable to a table.
for the new variable name, followed by a click on Add, as in Figure 3.8. A new empty column appears on the extreme right hand side of the table (Figure 3.9, p. 19).
To calculate the rate, chooseField Calculationin the drop down menu (right click on the table) and click on the right hand tab (Rate Operations) in the Field Calculation dialog, as shown in Figure 3.7. This invokes a dialog specific to the computation of rates (including rate smoothing). For now, select the Raw Rate method and make sure to have SIDR74 as the result, SID74 as the Event and BIR74 as the base, as illustrated in Figure 3.7. Click OKto have the new value added to the table, as shown in Figure 3.10 on p. 19.
As expressed in Figure 3.10, the rate may not be the most intuitive to in- terpret. For example, you may want to rescale it to show it in a more familiar form used by demographers and epidemiologists, with the rate expressed per 100,000 births. InvokeField Calculationagain, and, this time, select the second tab forBinary Operations. Rescale the variable SIDR74asSIDR74 MULTIPLY 100,000(simply type the 100,000 over the variable nameAREA), as in Figure 3.11 on p. 20. To complete the operation, click onOKto replace
Figure 3.9: Table with new empty column.
Figure 3.10: Computed SIDS death rate added to table.
the SIDS death rate by its rescaled value, as in Figure 3.12 on p. 20. The newly computed values can immediately be used in all the maps and statistical procedures. However, it is important to remember that they are “temporary” and can still be removed (in case you made a mistake). This is accomplished by selectingRefresh Datafrom the Tablemenu or from the drop down menu in the table.
The new variables become permanent only after you save them to a shape file with a different name. This is carried out by means of the Save to Shape File As option.3 The saved shape file will use the same map as
3
This option only becomes activeafter some calculation or other change to the table has been carried out.
Figure 3.11: Rescaling the SIDS death rate.
Figure 3.12: Rescaled SIDS death rate added to table.
the currently active shape file, but with the newly constructed table as its
dbf file. If you dont care about the shape files, you can remove the new .shp and .shx files later and use the dbf file by itself (e.g., in a spreadsheet or statistics program).
Experiment with this procedure by creating a rate variable for SIDR74 and SIDR79and saving the resulting table to a new file. Clear all windows and open the new shape file to check its contents.
3.5
Practice
Clear all windows and load the St. Louis sample data set with homicides for 78 counties (stl hom.shpwithFIPSNOas theKey). Create a choropleth map (e.g., quintile map or standard deviational map) to activate the table. Use the selection tools in the table to find out where particular counties are
located (e.g., click on St. Louis county in the table and check where it is in the map). Sort the table to find out which counties has no homicides in the 84–88 period (HC8488= 0). Also use the range selection feature to find the counties with fewer than 5 homicides in this period (HC8488<5).
Create a dummy variable for each selection (use a different name in- stead of the default REGIME). Using these new variables and the Field Calculation functions (not the Range Selection), create an additional selection for those counties with a nonzero homicide count less than 5. Ex- periment with different homicide count (or rate) variables (for different pe- riods) and/or different selection ranges.
Finally, construct a homicide rate variable for a time period of your choice for the St. Louis data (HCxxxxandPOxxxxare respectively theEvent and Base). Compare your computed rates to the ones already in the table (HRxxxx). Rescale the rates to a different base and save the new table as a shape file under a different name. Clear all windows and load the new shape file. Check in the table to make sure that all the new variables are there. Experiment with some of the other calculation options as well.
Exercise 4
Creating a Point Shape File
4.1
Objectives
This exercise illustrates how you can create a point shape file from a text or dbf input file in situations where you do not have a proper ESRI formatted shape file to start out with. SinceGeoDa requires a shape file as an input, there may be situations where this extra step is required. For example, many sample data sets from recent texts in spatial statistics are also available on the web, but few are in a shape file format. This functionality can be accessed without opening a project (which would be a logical contradiction since you don’t have a shape file to load). It is available from the Tools menu.
At the end of the exercise, you should know how to: • format a text file for input intoGeoDa
• create a point shape file from a text input file or dbf data file
More detailed information on these operations can be found inUsers’s Guide
pp. 28–31.