Professional Documents
Culture Documents
Pisati 1
Pisati 1
in Stata
Maurizio Pisati
University of Milano Bicocca – Italy
maurizio.pisati@unimib.it
Thematic maps
Examples:
– A sociologist could use a choropleth map (a.k.a.
shaded map) to show how the percentage of
families below the poverty line varies across the
states or the provinces of a given country
– A police officer could be interested in analyzing a
dot map showing the locations of drug markets
within a given city
Software for thematic mapping
Specifically:
– graph twoway area is used to draw the outlines
of the geographical areas of interest and to fill them
with the appropriate colors
– graph twoway scatter is used to plot the
proper symbols or labels when required
Required datasets
id land turnout
1 Baden-Wuerttemberg 62.6
2 Bayern 57.1
3 Bremen 61.3
4 Hamburg 68.7
5 Hessen 64.6
6 Niedersachsen 67.0
7 Nordrhein-Westfalen 56.7
8 Rheinland-Pfalz 62.1
9 Saarland 55.5
10 Schleswig-Holstein 66.5
11 Brandenburg 56.4
12 Mecklenburg-Vorpommern 70.6
13 Sachsen 59.6
14 Sachsen-Anhalt 56.5
15 Thueringen 53.8
16 Berlin 68.1
Boundary dataset
A3
A2
A1 A1
Boundary dataset: example
+-------------------------+
| _ID _X _Y _ISLAND |
|-------------------------|
| 1 . . 0 | <- Polygon 1: start
| 1 10 10 0 |
| 1 10 30 0 |
| 1 18 30 0 |
| 1 18 10 0 |
| 1 10 10 0 | <- Polygon 1: end
| 1 . . 0 | <- Polygon 2: start
| 1 22 10 0 |
| 1 22 30 0 |
| 1 30 30 0 |
| 1 30 10 0 |
| 1 22 10 0 | <- Polygon 2: end
|-------------------------|
| 2 . . 0 | <- Polygon 3: start
| 2 10 30 0 |
| 2 10 50 0 |
| 2 30 50 0 |
| 2 30 30 0 |
| 2 10 30 0 | <- Polygon 3: end
|-------------------------|
| 3 . . 1 | <- Polygon 4: start
| 3 22 48 1 |
| 3 28 48 1 |
| 3 28 42 1 |
| 3 22 42 1 |
| 3 22 48 1 | <- Polygon 4: start
+-------------------------+
Boundary dataset: mif2dta
mif2dta is a simple Stata program that converts
MapInfo Interchange Format boundary files into Stata
boundary datasets
mif2dta converts any given pair of files
rootname.mif and rootname.mid into a new pair of
Stata datasets: rootname-Coordinates.dta (the
boundary dataset) and rootname-Database.dta (the
master dataset)
Optionally, mif2dta also computes the coordinates of
the centroids of the geographical areas of interest
Boundary dataset: shapefiles