|
T=14;N=28;y=log(wjx(:,[1]));x=wjx(:,[2,3,4,5,6]);xconstant=ones(N*T,1);[nobs K]=size(x);
results=ols(y, [xconstant x]);
vnames=strvcat('y', 'cons','x1','x2','x3','x4','x5');
prt_reg(results, vnames,1);
sige=results.sige*((nobs-K)/nobs);
loglikols=-nobs/2*log(2*pi*sige)-1/(2*sige)*results.resid'* results.resid
Lmsarsem_panel(results,W,y, [xconstant x]);
I=eye(T);W1=kron(I,W);
res=moran(y,[ xconstant x],W1);
prt(res);
Ordinary Least-squares Estimates
Dependent Variable = y
R-squared = 0.7451
Rbar-squared = 0.7417
sigma^2 = 0.0014
Durbin-Watson = 1.1117
Nobs, Nvars = 392, 6
***************************************************************
Variable Coefficient t-statistic t-probability
cons 2.154693 283.362114 0.000000
x1 0.000002 8.451497 0.000000
x2 0.000004 8.790314 0.000000
x3 0.000002 2.753406 0.006177
x4 -0.385108 -3.296713 0.001069
x5 -0.005860 -3.258346 0.001220
loglikols =
735.8815
LM test no spatial lag, probability = 9.4578, 0.002
robust LM test no spatial lag, probability = 7.3689, 0.007
LM test no spatial error, probability = 131.7831, 0.000
robust LM test no spatial error, probability = 129.6942, 0.000
Moran I-test for spatial correlation in residuals
Moran I 0.47245706
Moran I-statistic 12.75797845
Marginal Probability 0.00000000
mean -0.00834460
standard deviation 0.03768635
>> info.lflag=0;info.model=0;result=sar_panel_FE(y,x,W,T,info);vnames=strvcat('y','x1','x2','x3','x4','x5');prt_spnew(results, vnames,1);
Wrong # of variable names in prt_sp -- check vnames argument
will use generic variable names
??? Error using ==> prt_spnew at 81
results structure not known by prt_sp function
|