dengjhui 发表于 2019-3-6 13:02
请问知道怎么用吗?就是如何加载自己的数据跟其他模型一样。
A=xlsread('D:\matlab\toolbox\SpatEcon_ren\Files_SLX_paper\cigarette.xls');
W1=xlsread('D:\matlab\toolbox\SpatEcon_ren\Files_SLX_paper\Spat-Sym-US.xls');
%
T=9; % number of time periods
N=31; % number of regions
% row-normalize W
W=normw(W1); % function of LeSage
y=A(:,1); % column number in the data matrix that corresponds to the dependent variable
x=A(:,[2,3,4,5,6,7,8,9]); % column numbers in the data matrix that correspond to the independent variables
for t=1:T
t1=(t-1)*N+1;t2=t*N;
wx(t1:t2,:)=W*x(t1:t2,:);
end
xconstant=ones(N*T,1);