楼主: zwa222
14553 14

[一般统计问题] 求教:spwmatrix [推广有奖]

  • 1关注
  • 9粉丝

已卖:902份资源

副教授

69%

还不是VIP/贵宾

-

威望
0
论坛币
1796 个
通用积分
14.1658
学术水平
9 点
热心指数
13 点
信用等级
4 点
经验
3799 点
帖子
579
精华
0
在线时间
1226 小时
注册时间
2006-11-29
最后登录
2025-11-15

楼主
zwa222 发表于 2010-8-13 10:33:23 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
现设有各省市的经纬度数据,在STATA中,用spwmatrix 来进行权重的生成.结果出错.请问谁知道是怎么回事吗?谢谢!
所用的命令是:  spwmatrix gecon latitude longitude , wn(wbin) wtype(bin) db(0 10) r(6371.009) row
   结果显示出错              <istmt>:  3499  CalcSPweightM() not found
CalcSPweightM() 找不到?
数据如下,拷贝可用.万乞高手指教!

id
longitude
latitude
340000
119.00
31.00
110000
116.43
39.91
500000
106.56
29.56
350000
118.00
26.00
620000
102.00
38.00
440000
113.00
23.00
450000
109.00
24.00
520000
107.00
27.00
460000
109.50
19.20
130000
114.30
38.02
230000
128.00
48.00
410000
114.00
34.00
420000
112.00
31.00
430000
112.00
28.00
320000
120.25
31.75
360000
116.00
28.00
220000
126.55
43.85
210000
123.00
41.00
150000
111.41
40.48
640000
106.00
37.00
630000
96.00
36.00
610000
109.00
35.00
370000
118.00
36.00
310000
121.29
31.14
140000
112.00
37.00
510000
105.00
29.83
120000
117.12
39.02
650000
82.00
38.00
540000
88.00
29.00
530000
101.00
24.00
330000
120.00
29.00
二维码

扫码加我 拉你入群

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

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

关键词:spwmatrix matrix Mat PWM wma Stata spwmatrix

沙发
zhaowill 发表于 2010-8-13 14:30:38
临界距离宽度设置过低了,10公里以内才有空间依赖性吗?试一下:
spwmatrix gecon latitude longitude, wn(wbin)  wtype(bin) db(0 500)  r(3958.761) row
能出结果,但不能行标准化,因为Elements of 2 rows sum up to zero,有两行的权重值之和为零。

藤椅
zwa222 发表于 2010-8-13 15:04:27
2# zhaowill
感谢指点!但调整了边界值之后,依然显示出错.且为同样的错误提示:

. spwmatrix gecon latitude longitude, wn(wbin)  wtype(bin) db(0 500)  r(3958.761) row
                 <istmt>:  3499  CalcSPweightM() not found
r(3499);


请问,你那里能成功执行这句命令吗?结果能正常出来吗?
        CalcSPweightM()  应该是一个函数吧?我这总是提示说找不到它.请问要如何才能安装(加载)这个函数?

诚挚的谢意!

板凳
zwa222 发表于 2010-8-13 15:19:24
我用STATA11.0的绿色版,运行之后,错误提示变为了:

. spwmatrix gecon latitude longitude, wn(wbin)  wtype(bin) db(0 500)   row


(colmax() in lmatabase, compiled by Stata 11.1, is too new to be run by this version of
Stata and so was ignored)
         CalcSPweightM():  3499  colmax() not found
                 <istmt>:     -  function returned error
r(3499);


与前述STATA10.1的运行结果的错误的提示基本相同,但还是略有差异.,请熟悉STATA的朋友帮忙指点一下.再谢!

报纸
zhaowill 发表于 2010-8-13 16:24:32
我用的是stata11绿色版,能出结果啊。
spwmatrix gecon latitude longitude, wn(wbin)  wtype(bin) db(0 500)  r(3958.761) row

N.B.: Elements of 2 rows sum up to zero, weighting matrix was not row-standardized

These rows are:
  28
  29
You might want to rethink your weights structure criteria.
Use nearstat to obtain distance information and a neighbor count
for your distance-cutoff or distance band.

Binary distance spatial weights matrix calculated successfully and the following actions taken:

- Spatial weights matrix  created as Stata object(s): wbin.

- N.B.: Stata spatial weights matrix, wbin, can be used as if it was created by the user-written command spatwmat.

. mat list  wbin

symmetric wbin[31,31]
           0    0    0  500  500  500  500  500  500  500  500  500  500  500  500  500  500  500  500  500  500
SWMDist    0
    Yes    0    0
    Yes    0    0    0
    Yes    1    0    0    0
    Yes    0    0    0    0    0
    Yes    0    0    0    1    0    0
    Yes    0    0    1    0    0    1    0
    Yes    0    0    1    0    0    1    1    0
    Yes    0    0    0    0    0    1    1    0    0
    Yes    0    1    0    0    0    0    0    0    0    0
    Yes    0    0    0    0    0    0    0    0    0    0    0
    Yes    1    1    0    0    0    0    0    0    0    1    0    0
    Yes    1    0    1    0    0    0    0    1    0    0    0    1    0
    Yes    1    0    1    1    0    1    1    1    0    0    0    1    1    0
    Yes    1    0    0    1    0    0    0    0    0    0    0    1    1    0    0
    Yes    1    0    0    1    0    1    0    0    0    0    0    1    1    1    1    0
    Yes    0    0    0    0    0    0    0    0    0    0    1    0    0    0    0    0    0
    Yes    0    1    0    0    0    0    0    0    0    0    0    0    0    0    0    0    1    0
    Yes    0    1    0    0    0    0    0    0    0    1    0    1    0    0    0    0    0    0    0
    Yes    0    0    0    0    1    0    0    0    0    1    0    1    0    0    0    0    0    0    1    0
    Yes    0    0    0    0    1    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
    Yes    0    0    1    0    1    0    0    0    0    1    0    1    1    0    0    0    0    0    1    1    0
    Yes    1    1    0    0    0    0    0    0    0    1    0    1    1    0    1    0    0    1    1    0    0
    Yes    1    0    0    1    0    0    0    0    0    0    0    1    0    0    1    1    0    0    0    0    0
    Yes    0    1    0    0    0    0    0    0    0    1    0    1    1    0    0    0    0    0    1    1    0
    Yes    0    0    1    0    0    0    1    1    0    0    0    0    1    1    0    0    0    0    0    1    0
    Yes    0    1    0    0    0    0    0    0    0    1    0    1    0    0    0    0    0    1    1    0    0
    Yes    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
    Yes    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
    Yes    0    0    0    0    0    0    0    1    0    0    0    0    0    0    0    0    0    0    0    0    0
    Yes    1    0    0    1    0    0    0    0    0    0    0    1    1    1    1    1    0    0    0    0    0

         500  500  500  500  500  500  500  500  500  500
    Yes    0
    Yes    0    0
    Yes    0    1    0
    Yes    1    1    0    0
    Yes    1    0    0    0    0
    Yes    0    1    0    1    0    0
    Yes    0    0    0    0    0    0    0
    Yes    0    0    0    0    0    0    0    0
    Yes    0    0    0    0    1    0    0    0    0
    Yes    0    1    1    0    0    0    0    0    0    0

地板
zwa222 发表于 2010-8-13 16:37:55
5# zhaowill
兄弟,谢谢了!我也终于把它搞出来了!简直是精疲力竭啊!确实,STATA10.1的版本不成,需要STATA11的! 再谢谢了!

7
jzbd 发表于 2010-8-14 00:52:43
学习一下。

8
zhangtao 发表于 2010-8-16 08:27:25
我运行后的结果如下,是什么原因?
spwmatrix gecon latitude longitude, wn(wbin)  wtype(bin) db(0 50
> 0)  r(3958.761) row

Binary distance spatial weights matrix calculated successfully and
>  the following actions taken:

- Spatial weights matrix  created as Stata object(s): wbin.

- N.B.: Stata spatial weights matrix, wbin, can be used as if it
> was created by the user-written command spatwmat.

- Spatial weights matrix has been row-standardized.
另外,这个空间权重矩阵做出后,下一下用什么命令?

9
ywh19860616 发表于 2010-8-16 14:30:48
楼上 兄弟们各省经纬度是用省会城市代替?

10
zwa222 发表于 2010-8-19 20:38:29
[quote]zhangtao 发表于 2010-8-16 08:27
我运行后的结果如下,是什么原因?
..................
- Spatial weights matrix  created as Stata object(s): wbin.
................................

兄弟,从你的运行结果看,好像没有什么问题!矩阵已经生成,可以查看之.

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-31 08:54