Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: tmap problem -- extra lines


From   June Spector <[email protected]>
To   [email protected]
Subject   st: tmap problem -- extra lines
Date   Mon, 19 Oct 2009 19:29:41 -0700

Hello,

I'm having difficulty with tmap -- in particular, there are many extra
lines that seem to have been drawn between points in the map that was
created (the map has many extra horizontal lines and looks messy).

I have an administrative dataset with zip codes and number of patient
visits for each zip code (variable for zip codes called "NAME",
variable for frequency called "_freq," and file named "zip.dta").  I
would like to create a state map that illustrates this.  I tried the
following:

* downloaded zipcode shp files by state from
http://www.census.gov/geo/www/cob/z52000.html (e.g. for Washington
state, file called zt53_d00)
set mem 100m
shp2dta using zt53_d00, database(wadb) coordinates(wacoord) genid(id)
use wadb
dmerge NAME using zip
replace _freq=0 if _freq==.
* saved dataset as wadbmerge.dta
tmap choropleth _freq, id(id) map(wacoord.dta) palette(Blues)

******
I tried "drop if _merge!=3" prior to the tmap command, but then whole
areas of the map drop out.  I also tried using a different shp file
(from https://wagda.lib.washington.edu/data/geography/us/vector/) --
the result was improved, but there still were extra lines.

******

* In case it helps, this is how I created zip.dta:
insheet using zip.csv
rename v1 NAME
sort NAME
contract NAME
* saved as zip.dta

Any advice would be greatly appreciated!

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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