Geographically Weighted Regression & 2D Mapping
Formatting Data for the Stand-Alone GWR Program
Here’s an example using U.S. Census data.
In the GWR stand-alone program, create folders for ‘Data,’ ‘Output,’ and
Obtain a census tract shapefile and a tract socio-demographic layer.
In ArcCatalog set a coordinate system for the shapefile.
Of course, instead of census tract data you could use block group data
or block data.
U.S. Census block group and block data have more spatial units
than tract data and so will considerably slow down the GWR
Whether or not a
particular data set represents a
random sample has serious implications for the
statistical analysis of the GWR output.
In ArcMap, set the coordinate system and to store relative paths.
Add the shapefile and sociodemographic layer to ArcMap.
In ArcMap, table join the two layers, selecting from the state-level data the
spatial unit (e.g., Orleans Parish) that you intend to analyze by clicking
‘Advanced’ and specifying ‘Keep only matching files.’
Export and save the table join as a new layer, and undo the original table
In the new layer, create X and Y centroid fields, and create the variables you
intend to analyze in GWR.
Do exploratory analysis to identify and eliminate spatial units (e.g., units with
no or sparse population; extreme outlier units in other respects) that could
distort the GWR results.
If you eliminate spatial units at this stage, you may ultimately
want to map the reduced-size shapefile together with the
original shapefile, symbolizing the eliminated units as, e.g.,
See the notes on how to do so at the end of this assignment
Use Excel, Stata, SPSS, or other statistical program to delete unnecessary
In general, keep STFID (or some ID field without text), X and Y
centroids, and the variables (without text) that you intend to analyze.
Double-check to make sure that the ID field, etc., is correct.
E.g., statistical programs such as Stata may unsort the
ID-variable, which has to be resorted before saving the
data for use in GWR and ArcMap.
Do not include any field/variable that contains text.
include STFID but not GEO_ID, because GEO_ID contains text.
Use Excel to save this streamlined data with a .csv extension in GWR’s ‘Data’
It seems that Excel, but not StatTransfer, should be used to do this.