全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
1558 2
2015-06-19
>> 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.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-6-20 09:14:54
你输入的变量矩阵有问题吧,还有你都不用将矩阵标准化?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-7-9 10:05:24
ZTwuha 发表于 2015-6-20 09:14
你输入的变量矩阵有问题吧,还有你都不用将矩阵标准化?
应该是变量矩阵的问题,请教您变量矩阵具体应该是什么形式呢……
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群