楼主: zwa222
8591 7

[作图问题求助] 一个简单的复杂问题! [推广有奖]

  • 1关注
  • 9粉丝

副教授

69%

还不是VIP/贵宾

-

威望
0
论坛币
1974 个
通用积分
15.3213
学术水平
9 点
热心指数
13 点
信用等级
4 点
经验
3364 点
帖子
584
精华
0
在线时间
1218 小时
注册时间
2006-11-29
最后登录
2024-2-3

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
请教:我在STATA10里,要做一个地图编辑.用的是tmap命令.完全是按照那个帮助文件
http://www.stata.com/support/faqs/graphics/tmap.html
的步骤来做的.结果在第三步就不行了.请问是何故呀?就是说,在运行下述命令时,就总是提示出错了(因为文件名称已经变动,所以是用的"s_01au07:")
. shp2dta using s_01au07, database(usdb) coordinates(uscoord) genid(id)
. shp2dta using s_01au07, database(usdb) coordinates(uscoord) genid(id)
             st_addobs():   901  Stata returned error
              read_shp():     -  function returned error
                 <istmt>:     -  function returned error
看不明白这个提示是错在哪里?应该怎么做啊?按照步骤做,应该是很简单的,怎么就不出来结果呢?谢谢指点!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:复杂问题 Coordinates coordinate database function Stata 地图 帮助

沙发
zhaowill 发表于 2010-8-5 22:34:11 |只看作者 |坛友微信交流群
帮你验算了一下,是正常的呀。
你下载了数据文件没有?就是一个压缩文件s_01au07.zip。
将其解压缩后得到三个文件
s_01au07.dbf
s_01au07.shx
s_01au07.shp
其实我们只需要其中的两个文件:s_01au07.shp and s_01au07.dbf. 把这两个文件拷贝到stata的当前工作目录,输入命令:shp2dta using s_01au07, database(usdb) coordinates(uscoord) genid(id)
即可得到结果:即文件uscoord.dta和usdb.dta

使用道具

藤椅
zwa222 发表于 2010-8-5 23:20:10 |只看作者 |坛友微信交流群
2# zhaowill
谢谢你!
但还是不知怎么的,,还是有问题:
首先,我解压的文件总是4个:除了你说的三个之外,还有一个是 s_01au07.prj .而你说的,以及那个帮助文件上也是只有那三个文件,不明白这是为什么?也不晓得最后的结果不能正常的表示与这个有没有关系?
其次,我完全按照那帮助的程度步骤做的,可最后一步时,显示出错:

. tmap choropleth pop1990, id(id) map(uscoord.dta) palette(Blues)
invalid file specification
r(198);

我不知道它这个"invalid file specification"是什么意思?是说文件设置非法吗?我可是完全照着做的呀!
还请你再帮忙指导一下,万分之感谢!

使用道具

板凳
zhaowill 发表于 2010-8-6 13:34:19 |只看作者 |坛友微信交流群
s_01au07.prj 也是有的,不过它无关紧要。
按照提示的步骤可以出正确结果,详细命令如下。
我这里用的是spmap命令,它和tmap的功能应该是一样的。

. shp2dta using s_01au07, database(usdb) coordinates(uscoord) genid(id)
. use usdb, clear
. describe

Contains data from usdb.dta
  obs:            57                          
vars:             6                          6 Aug 2010 13:16
size:         2,565 (99.9% of memory free)
----------------------------------------------------------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
----------------------------------------------------------------------------------------------------------------------------------
STATE           str2   %9s                    
NAME            str20  %20s                  
FIPS            str2   %9s                    
LON             double %10.0g                 
LAT             double %10.0g                 
id              byte   %12.0g                 
----------------------------------------------------------------------------------------------------------------------------------
Sorted by:  id

. list id NAME in 1/5

     +---------------------------+
     | id                   NAME |
     |---------------------------|
  1. |  1   District of Columbia |
  2. |  2                Arizona |
  3. |  3                   Ohio |
  4. |  4                        |
  5. |  5             California |
     +---------------------------+
*数据文件stats和trans需先下载置于当前工作目录
. use stats
. merge scode using trans, sort unique
(note: you are using old merge syntax; see [D] merge for new syntax)
. tabulate _merge

     _merge |      Freq.     Percent        Cum.
------------+-----------------------------------
          3 |         51      100.00      100.00
------------+-----------------------------------
      Total |         51      100.00
. drop _merge
. merge id using usdb, sort unique
(note: you are using old merge syntax; see [D] merge for new syntax)
. tabulate _merge
     _merge |      Freq.     Percent        Cum.
------------+-----------------------------------
          2 |          6       10.53       10.53
          3 |         51       89.47      100.00
------------+-----------------------------------
      Total |         57      100.00
. drop if _merge!=3
(6 observations deleted)
. spmap pop1990 using uscoord if id !=13 & id!=56, id(id) fcolor(Blues)

spmap pop1990 using uscoord if NAME!="Alaska" & NAME!="Hawaii", id(id) fcolor(Blues)
已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
Sunknownay + 100 + 10 + 1 + 1 + 1 热心帮助其他会员

总评分: 经验 + 100  论坛币 + 10  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

使用道具

报纸
zwa222 发表于 2010-8-7 17:33:12 |只看作者 |坛友微信交流群
4# zhaowill
感谢了!
用你所说的命令:spmap:,问题解决了!(同样相似的操作,用tmap命令实现不了!)
所以,不行的帮助链接:http://www.stata.com/support/faqs/graphics/tmap.html
         可行的帮助链接:http://www.stata.com/support/faqs/graphics/spmap.html
二者的区别仅仅是:tmap  <--->spmap

再次表示感谢!

使用道具

地板
蓝色 发表于 2010-8-8 08:49:05 |只看作者 |坛友微信交流群
spmap是更加新的命令

使用道具

7
tafuman 发表于 2011-4-28 23:49:25 |只看作者 |坛友微信交流群
最好在stata11里做。
好好学习、天天向上

使用道具

8
jrbzsn 发表于 2013-4-15 05:29:18 |只看作者 |坛友微信交流群
回复楼主最初的帖子,问题在于的内存太小,set memory 就可以了

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-6-19 07:21