>> A=load('E:\matlab\pc.mat');
W1=load('E:\matlab\w2.mat');
T=11; % number of time periods
N=28; % number of regions
y=A(:,[1]); % column number in the data matrix that corresponds to the dependent variable
x=A(:,[2,3,4]); % column numbers in the data matrix that correspond to the independent variables
xconstant=ones(N*T,1);
[nobs K]=size(x);
% ----------------------------------------------------------------------------------------
% ols estimation
results=ols(y,[xconstant x]);
vnames=strvcat('logy','intercept','logp','logpn','lz');
prt_reg(results,vnames,1);
??? Index exceeds matrix dimensions.
info.lflag=0; % required for exact results
info.model=1;
info.fe=0; % no print intercept and spatial fixed effects
results=sar_panel_FE(y,x,W,T,info);
vnames=strvcat('upg2','intercept','lK','lz','lrwork2');
prt(results,vnames,1);
blagfe=[results.beta;results.rho];
covblagfe=results.cov;
logliklagfe=results.lik;
info.model=0;
results=sar_panel_FE(y,x,W,T,info);
logliklag=results.lik;
LR=-2*(logliklag-logliklagfe);
dof=N;
probability=1-chis_prb(LR,dof);
fprintf(1,'LR-test joint significance spatial fixed effects, degrees of freedom and probability = %9.4f,%6d,%9.4f \n',LR,dof,probability);"
??? Index exceeds matrix dimensions.