load AGDP2.mat;
load w1.mat;
T=7; % number of time periods
N=30; % number of regions
% row-normalize W
W=normw(W); % function of LeSage
A= AGDP2;
y=A(:,[1]); % column number in the datamatrix that corresponds to the dependent variable
x=A(:,[2,3]); % column numbers in the datamatrix 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
for t=1:T
t1=(t-1)*N+1;t2=t*N;
wx(t1:t2,:)=W*x(t1:t2,:);
end
这一段代码出现了 Subscripted assignment dimension mismatch.的报错。
但问题是自变量只有一个的时候,即x=A(:,[2])或x=A(:,[3])是没有问题的,但是自变量变成两个x=A(:,[2,3]),就出错了。
我是在做杜宾空间面板模型的,这个出错后面没法计算直接、间接效应,然后我想要的Wald、LR统计量无法得出。求高人解答