Académique Documents
Professionnel Documents
Culture Documents
Most charts and maps on this site were created with the Stata statistical software
package. This guide explains how maps like those with adult and youth literacy rates in
2010 can be created with Stata. The article supersedes an earlier version from 2005 and
introduces updated maps with current country borders. For example, South Sudan,
which seceded from Sudan in 2011, is shown as a separate country on the new maps.
The instructions below are for Stata version 9 or later. Users of Stata 8 are referred to
the guide from 2005. The creation of maps is not supported in older versions of Stata.
Requirements
spmap: Stata module for drawing thematic maps, by Maurizio Pisati. spmap can
be installed in Stata with this command:
ssc install spmap
shp2dta: Stata module for converting shapefiles to Stata format, by Kevin Crow.
shp2dta can be installed in Stata with this command:
ssc install shp2dta
Note: The instructions are accurate for Natural Earth maps version 2.0.0, the
most recent version of the maps available in April 2014.
Two new files will be created: worlddata.dta (with the country names and other
information) and worldcoor.dta (with the coordinates of the country boundaries).
If you plan to superimpose labels on a map, for example country names, run the
following command instead, which adds centroid coordinates to the file
worlddata.dta:
shp2dta using ne_110m_admin_0_countries,
data(worlddata) coor(worldcoor) genid(id) genc(c)
The DBF, PRJ, SHP, and SHX files are no longer needed and can be deleted.
For the example maps, create a variable with the length of each country's name.
The Stata command for this is:
generate length = length(admin)
Draw a map that indicates the length of all country names with this command:
spmap length using worldcoor.dta, id(id)
The default map (Figure 1) is grayscale, it shows Antarctica, there are four
classes for the length of the country names, the legend is very small, and the
legend values are arranged from high to low.
A second map without Antarctica, with a blue palette, five classes, and with a
bigger legend with values arranged from low to high (Figure 2) can be drawn
with this command:
spmap length using worldcoor.dta if admin!
="Antarctica", id(id) fcolor(Blues) clnumber(5)
legend(symy(*2) symx(*2) size(*2)) legorder(lohi)
Darker colors on the map indicate longer country names, ranging from 4 (for
example Cuba and Fiji) to 35 characters (French Southern and Antarctic Lands).
Please read the Stata help file for spmap to learn about the many additional
options for customization of maps.
To create the map in Figure 3, download this shapefile from Natural Earth,
which has information for 241 countries and territories:
ne_50m_admin_0_countries.zip (799 KB, world map with country borders,
scale 1:50,000,000)
If you need Stata files with centroids, run this command instead:
shp2dta using ne_50m_admin_0_countries,
data(worlddata2) coor(worldcoor2) genid(id) genc(c)
The map takes longer to draw than the map in Figures 1 and 2 because it is more
detailed and shows more geographic units. The names of the countries and
territories on the map have a length up to 40 characters (South Georgia and
South Sandwich Islands).
To create the map in Figure 4, download this shapefile from Natural Earth,
which has information for 255 countries and territories, including small islands
like the Ashmore and Cartier Islands:
ne_10m_admin_0_countries.zip (5.1 MB, world map with country borders, scale
1:10,000,000)
If you need Stata files with centroids, run this command instead:
shp2dta using ne_10m_admin_0_countries,
data(worlddata3) coor(worldcoor3) genid(id) genc(c)
The map takes longer to draw than the maps in Figures 1, 2 and 3 because it has
the largest amount of detail. The differences between the maps in Figures 3 and
4 can be seen by clicking on the images to enlarge them. Figure 4 has more
islands and more detailed shorelines. The names of the countries and territories
on the map in Figure 4 have a length up to 40 characters (South Georgia and
South Sandwich Islands).
shp2dta: Stata module for converting shapefiles to Stata format, by Kevin Crow
Related articles
Guide to creating maps with Stata (previous version of this guide, from 2005)
External links
Shapefile (Wikipedia)
Centroid (Wikipedia)
PGINAS ESPAOL
https://alexplatasl.blogspot.pe/2015/11/mapeo-en-stata-1-de-2.html
https://alexplatasl.blogspot.pe/2015/11/en-la-anterior-entrada-mostramoscomo.html
VIDEOS
https://www.youtube.com/watch?v=jGMd83k0cKQ
PGINAS INGLS
http://huebler.blogspot.pe/2012/08/stata-maps.html
ARCHIVOS SHAPEFILE
http://www.geogpsperu.com/2014/03/base-de-datos-peru-shapefile-shpminam.html