全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
25348 26
2010-08-14
在spwmatrix 命令中,有一条是说可以生成“经济”空间权重矩阵(WE)。
        wtype(bin|inv|econ|invecon|socnet|socecon) indicates whether binary,
        distance decay, economic distance, inverse economic distance, social
        network, or socio-economic spatial weights should be created.
同时里面也给出了个例子:
4) Generate an economic distance spatial weights matrix using employment  as the economic variable
      run:    spwmatrix gecon latitude longitude, wn(wecon) wtype(econ)  econvar(employment) rowstand.

于此,我就用自己的数据(数据里面包括 latitude, longitude,GDP),我是打算用GDP作为权重的,例子中是用employment的。
我运行后出现以下字母(红色的)
        _=invalid name

        

     SOS ,不知道这是为什么。???
二维码

扫码加我 拉你入群

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

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

全部回复
2010-8-14 20:49:07
自己顶一下。
二维码

扫码加我 拉你入群

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

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

2010-8-15 12:09:26
把数据附上。
二维码

扫码加我 拉你入群

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

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

2010-8-15 18:49:22
楼上的,数据已经在这了。SOS,帮忙运算一下吧。 麻烦了。

数据都是很简单的,一个是经度变量,一个是纬度变量,一个是ID,另外一个变量时GDP。
现在来生成 经济空间矩阵,但就是出来。我是安装help 做的。
附件列表

W.xls

大小:19 KB

 马上下载

二维码

扫码加我 拉你入群

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

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

2010-8-16 17:16:29
. spwmatrix gecon latitude longitude, wname(wknn5) knn(5) rowstand

Nearest neighbor (5) spatial weights matrix calculated successfully and
>  the following actions taken:

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

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

- Spatial weights matrix has been row-standardized.

. spwmatrix socio village_id, wname(socecon_wght) row wtype(socecon)

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-s
> tandardized
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 c
> reated by the user-written command spatwmat.

为什么不出结果呢?
二维码

扫码加我 拉你入群

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

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

2010-8-16 17:19:30
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-s
> tandardized

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 c
> reated by the user-written command spatwmat.

. spwmatrix gecon latitude longitude, wn(wbin)  wtype(bin) db(0 200)  r
> (3958.761) row

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

These rows are:
  5
  6
  7
  9
  11
  12
  13
  14
  17
  18
  19
  20
  21
  22
  23
  28
  29
  30
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 c
> reated by the user-written command spatwmat.

.
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群