吴老师:
您好!
我还是有一点不太明白,比如我把一个程序文件打开了,里面的程序如下:
clear all;
A=wk1read('cigarette.wk1',1,0);
W1=wk1read('Spat-Sym-US.wk1');
% Dataset downloaded from www.wiley.co.uk/baltagi/
% Source: Baltagi and Levin (1992) and Baltagi, Griffin and Xiong (2000).
% Description: Panel Data, 46 U.S. States over the period 1963-1992.
% Spatial weights matrix constructed by Elhorst
%
% written by: J.Paul Elhorst 9/2004
% University of Groningen
% Department of Economics
% 9700AV Groningen
% the Netherlands
% j.p.elhorst@eco.rug.nl
%
% dimensions of the problem
T=30; % number of time periods
N=46; % number of regions
nobs=N*T;
% 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,5,6]); % column numbers in the data matrix that correspond to the independent variables
xconstant=ones(nobs,1);
% ----------------------------------------------------------------------------------------
% pooled model corrected for spatial autocorrelation, including intercept
info.lflag=0; % required for exact results
info.model=0;
results=sar_panel(y,[xconstant x],W,T,info); % Elhorst
vnames=strvcat('logcit','constant','logp','logpn','logy');
prt(results,vnames); % Elhorst
% ----------------------------------------------------------------------------------------
% spatial fixed effects + spatial autocorrelation
info.lflag=0;
info.model=1;
results=sar_panel(y,x,W,T,info);
vnames=strvcat('logcit','logp','logpn','logy');
prt(results,vnames);
% ----------------------------------------------------------------------------------------
% time period fixed effects + spatial autocorrelation
info.lflag=0;
info.model=2;
results=sar_panel(y,x,W,T,info);
vnames=strvcat('logcit','logp','logpn','logy');
prt(results,vnames);
% ----------------------------------------------------------------------------------------
% spatial and time period fixed effects + spatial autocorrelation
info.lflag=0;
info.model=3;
results=sar_panel(y,x,W,T,info);
vnames=strvcat('logcit','logp','logpn','logy');
prt(results,vnames);
它的这些程序好像没有普遍适用性,比如文件名'cigarette.wk1',1,0;怎么改它呢,比如我的excel名是currency,怎么使得这个程序能够计算数据呢?还有我主程序打开以后,m文件是怎么弄出来的呢,我的数据还在excel里面的,怎么把excel的数据弄成m文件,弄成m文件以后复制在什么地方呢,因为主程序打开以后有一个workspace,里面有一个数据导入,是直接把m文件导入进去么?我的关键问题就在于不会让程序计算我的数据文件,望吴老师赐教!