Statalist


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

Re: st: Tmap: "invalid file specification"


From   Friedrich Huebler <fhuebler@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Tmap: "invalid file specification"
Date   Tue, 22 Dec 2009 16:10:25 -0500

Dorothy,

This is not an answer to your question but I would suggest that you
use -spmap- instead of -tmap-. -spmap- is a newer Stata command by the
author of -tmap-.

http://www.stata.com/support/faqs/graphics/spmap.html

Regarding your problem, you wrote "I ran the exact code (using the
same files)" but you did not. The Stata example refers to uscoord.dta
in the -tmap- command while you refer to uscoordtrial.dta. This may
not be the source of your problem, however. Perhaps Stata is looking
for the file in the wrong directory. It would be useful if you could
reproduce the Stata output exactly as it appears in the Results
window.

Friedrich

On Tue, Dec 22, 2009 at 3:18 PM, Dorothy Bridges <dbstata@gmail.com> wrote:
> Dear Statalist,
>
> When I run a program based on the "Working with tmap" instructions
> (http://www.stata.com/support/faqs/graphics/tmap.html), I get the
> error message "invalid file specification" following the "tmap"
> command.  In an attempt to figure out what was going on, I ran the
> exact code (using the same files) suggested in the "Working with tmap"
> instructions.  My exact code is copied below.  The files are the same
> files used in the Stata example (and are available online).  Still, I
> get "invalid file specification" after the tmap line.
>
> I'd very much appreciate any suggestions.
>
> Sincerely,
> Dorothy
>
> clear
> set mem 500m
> cd "\\data4\users10\DKronick\My Documents\Dorothy\Giovanni"
>
> *Create files from map shapefile
> shp2dta using s_01au07, database(usdbtrial) coordinates(uscoordtrial)
> genid(id) replace
> *Note: s_01au07 is available at
> http://www.nws.noaa.gov/geodata/catalog/national/html/us_state.htm
>
> *Merge id variable with population data file (data of interest)
> use stats, clear
> merge scode using trans, sort unique
> drop _merge
>
> *Merge data of interest with map data
> merge id using usdbtrial, sort unique
> tab _merge
> drop if _merge!=3
>
> *Draw map
> tmap choropleth pop1990, id(id) map(uscoordtrial.dta) palette(Blues)

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index