make_neighborswd2.m

来自「计量工具箱」· M 代码 · 共 39 行

M
39
字号
% PURPOSE: An example of using make_neighborsw%          a nearest neighbor spatial weight matrix%          on a large data set                   %---------------------------------------------------% USAGE: make_neighborswd2%---------------------------------------------------% A data set for 1980 Presidential election results covering 3,107 % US counties. From Pace, R. Kelley and Ronald Barry. 1997. ``Quick% Computation of Spatial Autoregressive Estimators'',% in  Geographical Analysis.% %  Variables are:%  columns 1-4 are census identifiers %  column 5  = lattitude%  column 6  = longitude%  column 7  = population casting votes%  column 8  = population over age 19 eligible to vote%  column 9  = population with college degrees%  column 10 = homeownership%  column 11 = incomeclear all;load elect.dat;                    % load data on voteslatt = elect(:,5);long = elect(:,6);W2 = make_neighborsw(long,latt,2); % 4 neighborsW4 = make_neighborsw(long,latt,4);subplot(2,1,1),spyc(W2,'.r',1);subplot(2,1,2),spyc(W4,'.g',1);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?