Stata 15 help for spshape2dta

[SP] spshape2dta -- Translate shapefile to Stata format


spshape2dta name [, options]

options Description ------------------------------------------------------------------------- clear clear existing data from memory replace if name.dta or name_shp.dta exists, replace them saving(name2) create new files named name2.dta and name2_shp.dta instead of name.dta and name_shp.dta -------------------------------------------------------------------------

spshape2dta translates files name.shp and name.dbf. They must be in the current directory.

spshape2dta creates files name.dta and name_shp.dta. They will be created in the current directory. The data in memory, if any, remain unchanged.


Statistics > Spatial autoregressive models


spshape2dta name reads files name.shp and name.dbf and creates Sp dataset name.dta and translated shapefile name_shp.dta. The translated shapefile will be linked to the Sp dataset name.dta.


clear specifies to clear any data in memory.

replace specifies that if the new files being created already exist on disk, they can be replaced.

saving(name2) specifies that rather than the new files being named name.dta and name_shp.dta, they be named name2.dta and name2_shp.dta.


In your browser, search for "shapefile U.S. counties census" and find

Click on TIGER/Line Shapefiles - New 2016 Shapefiles. Doing so takes you to a page with a list of years. Select "2016" and click on Download. If given a choice between a web interface and an FTP site, click on Web interface. Then select 2016 and Counties (and equivalent) and click on Submit. On the new screen, click on Download national file.

File was downloaded to the Downloads directory on our computer.

You must be in the Downloads directory (that is, the same directory as this file) to run the spatial commands.

Unzip the files . unzipfile

Dataset setup . spshape2dta tl_2016_us_county

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index