欢迎来到天天文库
浏览记录
ID:53337949
大小:15.67 KB
页数:7页
时间:2020-04-03
《利用STATA创建空间权重矩阵及空间杜宾模型计算命令.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、**创建空间权重矩阵介绍*设置默认路径cdC:UsersxiuboDesktopF182013.v4F101994sheng**创建新文件*shp2dta:readsashape(.shp)anddbase(.dbf)filefromdiskandconvertsthemintoStatadatasets.*shp2dta:读取CHN_adm1文件*CHN_adm1:为已有的地图文件*database(chinaprovince):表示创建一个名称为“chinaprovince”的dBase数据集*database(filename):Specifiesfile
2、nameofnewdBasedataset*coordinates(coord):创建一个名称为“coord”的坐标系数据集*coordinates(filename):Specifiesfilenameofnewcoordinatesdataset*gencentroids(stub):Createscentroidvariables*genid(newvarname):Createsuniqueidvariablefordatabase.dtashp2dtausingCHN_adm1,database(chinaprovince)coordinates(coord)ge
3、nid(id)gencentroids(c)**绘制2016年中國GDP分布圖*spmap:Visualizationofspatialdata*clnumber(#):numberofclasses*id(idvar):basemappolygonidentifier(识别符,声明变量名,一般以字母或下划线开头,包含数字、字母、下划线)*_2016GDP:变量*coord:之前创建的坐标系数据集spmap_2016GDPusingcoord,id(id)clnumber(5)*更改变量名renamex_clongituderenamey_clatitude**生成距离矩阵
4、*spmat:用于定义与管理空间权重矩阵*Spatial-weightingmatricesarestoredinspatial-weightingmatrixobjects(spmatobjects).*spmatobjectscontainadditionalinformationaboutthedatausedinconstructingspatial-weightingmatrices.*spmatobjectsareusedinfittingspatialmodels;seespreg(ifinstalled)andspivreg(ifinstalled).*id
5、istance:(产生距离矩阵)createanspmatobjectcontaininganinverse-distancematrixW*或contiguity:createanspmatobjectcontainingacontiguitymatrixW*idistance_jingdu:命名名称为“idistance_jingdu”的距離矩陣*longitude:使用经度*latitude:使用纬度*id(id):使用id*dfunction(function[,miles]):(设置计算距离方法)specifythedistancefunction.*functi
6、onmaybeoneofeuclidean(default),dhaversine,rhaversine,ortheMinkowskidistanceoforderp,wherepisanintegergreaterthanorequalto1.*normalize(row):(行标准化)specifiesoneofthethreeavailablenormalizationtechniques:row,minmax,andspectral.*Inarow-normalizedmatrix,eachelementinrowiisdividedbythesumofrowi's
7、elements.*Inaminmax-normalizedmatrix,eachelementisdividedbytheminimumofthelargestrowsumandcolumnsumofthematrix.*Inaspectral-normalizedmatrix,eachelementisdividedbythemodulusofthelargesteigenvalueofthematrix.spmatidistanceidistance_jingdulongitudelatitude,id(id
此文档下载收益归作者所有