以长江经济带数据为例:1.先在网上搜索长江经济带.shp 和.dbf地图格式文件
2.用geoda软件读入上述两个文件
3.在geoda中点击W生成空间权重矩阵,即.gal格式空间权重文件,该文件笔记本可以打开,
4.将生成的geoda中空间权重矩阵.gal文件读入stata中生成dat文件,该文件r及matalab可以直接用,但stata不行。代码如下:
spwmatrix import using D:\stata13\ado\personal\cjjjddjs.gal, wname(wcontig) rowstand xport(cjjjd,dat)
5将dat文件用excel读入,并保存excel格式,然后用stata打开并保存stata格式就生成了stata格式及dta格式的空间权重矩阵,此时stata可以直接调用
6如果进行面板数据分析,需要将空间权重矩阵转换为.spmat格式,代码如下;cd D:\stata13\ado\personal
use kjqzjz.dta,clear
spmat dta iw var1- var30
spmat save iw using kjqzjz.spmat
spmat use kjqzjz using kjqzjz.spmat
use jjzzzl.dta ,clear
楼主你好,我用stata导入gal文件的时候出现下面这段话,请问有什么处理办法吗
. spwmatrix import using changjiang1.gal,wname(w1) rowstand xport(m1,dat)
J(): 3900 unable to allocate real <tmp>[510800,510800]
spwmatrix_CalcSPweightM(): - function returned error
<istmt>: - function returned error
r(3900);
点击r3900出现这个
search for r(3900) (manual: [R] search)
--------------------------------------------------------------------------------
Search of official help files, FAQs, Examples, SJs, and STBs
[M-2] error . . . . . . . . . . . . . . . . . . . . . . . . Return code 3900
out of memory
Mata is out of memory; the operating system refused to supply
what Mata requested. There is no Mata or Stata setting that
affects this, and so nothing in Mata or Stata to reset in order
to get more memory. You must take up the problem with your
operating system.
Web resources from Stata and other users
(contacting http://www.stata.com)
no matches
(click here to return to the previous screen)