T=15; % number of time periods
N=28; % number of regions
% row-normalize W
W=normw(W1); % function of LeSage
y=A(:,[3]); % column number in the data matrix that corresponds to the dependent variable
x=A(:,[4,8]); % 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( ‘y‘ ,‘x1‘,‘x2‘,‘x3’,‘x4’,‘x5’);
Ordinary Least-squares Estimates
R-squared = 0.9203
Rbar-squared = 0.9156
sigma^2 = 0.2994
Durbin-Watson = 0.4391
Nobs, Nvars = 420, 3
***************************************************************
Variable Coefficient t-statistic t-probability
variable 1 -0.178380 -2.341471 0.019678
variable 2 0.000023 1.391715 0.164751
variable 3 1.538205 1.682588 0.093203
在走这个程序的时候不停的出现Wrong # of variable names in prt_reg -- check vnames argument
will use generic variable names
可是vnames=strvcat( ‘y‘ ,‘x1‘,‘x2‘,‘x3’,‘x4’,‘x5’);实在不知道哪里出错了
下面的变量也是用的variable而不是我设置的变量代替的
论文很着急 望好心人解说下