楼主: L-dgao
58437 166

[程序分享] Matlab空间计量工具箱及Matlab空间面板数据模型操作简介   [推广有奖]

11
吴伟东e_two 发表于 2013-4-26 17:24:13 |只看作者 |坛友微信交流群
支持哈

使用道具

12
xuyeming1314 在职认证  发表于 2013-5-2 12:05:25 |只看作者 |坛友微信交流群
Warning: WK1READ will be removed in a future release.
Warning: WK1READ will be removed in a future release.
我想问问我输出的结果是
Error using ==> horzcat
CAT arguments dimensions are not consistent.

Error in ==> demoLMsarsem_panel at 30
results=ols(y,[xconstant x]);
这是怎么回事啊
这是我改了T,N和变量xy位置之后出现的情况,不该反而会有结果是怎么回事啊
还有就是A=wk1read('cigardemo.wk1',1,0);
W1=wk1read('Spat-Sym-US.wk1');
这两行需要改动吗?

使用道具

13
L-dgao 发表于 2013-5-2 12:56:16 |只看作者 |坛友微信交流群
xuyeming1314 发表于 2013-5-2 12:05
Warning: WK1READ will be removed in a future release.
Warning: WK1READ will be removed in a future ...
你再检查一下你前后变量的维度是不是一致的,首先逻辑上不能存在错误吧,关于这两行,这只是一个演示文件吧,你需要根据你自己的情况去修改,其实可以把你需要用的文件直接放在work文件夹下,直接去做修改运行即可

使用道具

14
xuyeming1314 在职认证  发表于 2013-5-2 13:38:51 |只看作者 |坛友微信交流群
L-dgao 发表于 2013-5-2 12:56
你再检查一下你前后变量的维度是不是一致的,首先逻辑上不能存在错误吧,关于这两行,这只是一个演示文件 ...
你好,很开心你能帮我的忙,
这个是原始工具箱里的部分
% dimensions of the problem
T=6; % number of time periods
N=46; % 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,5,6]); % column numbers in the data matrix that correspond to the independent variables
xconstant=ones(N*T,1);
[nobs K]=size(x);
% ----------------------------------------------------------------------------------------
输出的结果是
Warning: WK1READ will be removed in a future release.
Warning: WK1READ will be removed in a future release.

Ordinary Least-squares Estimates
Dependent Variable =        logcit   
R-squared      =    0.3861
Rbar-squared   =    0.3794
sigma^2        =    0.0320
Durbin-Watson  =    1.8047
Nobs, Nvars    =    276,     4
***************************************************************
Variable       Coefficient      t-statistic    t-probability
intercept         1.605485         5.435955         0.000000
logp             -1.041989        -8.610354         0.000000
logpn             0.146363         1.176771         0.240316
logy              0.703143        10.651591         0.000000


loglikols =

   85.5537

LM test no spatial lag, probability          =    2.8677,    0.090
robust LM test no spatial lag, probability   =    1.5139,    0.219
LM test no spatial error, probability        =    6.3199,    0.012
robust LM test no spatial error, probability =    4.9661,    0.026
Wrong # of variable names in prt_reg -- check vnames argument
will use generic variable names

Ordinary Least-squares Estimates
R-squared      =    0.4634
Rbar-squared   =    0.4595
sigma^2        =    0.0015
Durbin-Watson  =    1.8004
Nobs, Nvars    =    276,     3
***************************************************************
Variable        Coefficient      t-statistic    t-probability
variable 1        -0.597372       -12.071931         0.000000
variable 2         0.162570         2.598087         0.009883
variable 3         0.335686         9.102462         0.000000


FE_rsqr2 =

    0.9716


loglikfe =

  509.8241

LM test no spatial lag, probability          =   12.7208,    0.000
robust LM test no spatial lag, probability   =    4.7332,    0.030
LM test no spatial error, probability        =   23.6084,    0.000
robust LM test no spatial error, probability =   15.6207,    0.000
Wrong # of variable names in prt_reg -- check vnames argument
will use generic variable names

Ordinary Least-squares Estimates
R-squared      =    0.4272
Rbar-squared   =    0.4230
sigma^2        =    0.0013
Durbin-Watson  =    2.0461
Nobs, Nvars    =    276,     3
***************************************************************
Variable        Coefficient      t-statistic    t-probability
variable 1        -0.648719       -13.267854         0.000000
variable 2         0.067473         1.072247         0.284556
variable 3         0.317823         4.891167         0.000002

LM test no spatial lag, probability          =    0.9402,    0.332
robust LM test no spatial lag, probability   =    3.8306,    0.050
LM test no spatial error, probability        =    4.0933,    0.043
robust LM test no spatial error, probability =    6.9837,    0.008
以下是我对上述原始工具箱改的部分
% dimensions of the problem
T=13; % number of time periods
N=30; % number of regions
% row-normalize W
W=normw(W1); % function of LeSage
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);
% ----------------------------------------------------------------------------------------
输出的结果是
Warning: WK1READ will be removed in a future release.
Warning: WK1READ will be removed in a future release.
Error using ==> horzcat
CAT arguments dimensions are not consistent.

Error in ==> demoLMsarsem_panel at 30
results=ols(y,[xconstant x]);


我很奇怪 我的数据明明是13年的30个省份的面板数据,为什么我改后会错了呢?难道是我对x和y变量的位置改错了?不是y=A(:,[1]); x=A(:,[2,3,4]); 而是y=A(:,[3]); x=A(:,[4,5,6]);?

使用道具

15
gaozhan2003 发表于 2013-6-22 10:02:22 |只看作者 |坛友微信交流群
mark

使用道具

16
一点江湖 发表于 2013-7-16 13:13:33 |只看作者 |坛友微信交流群
同求啊

使用道具

17
无他 发表于 2013-7-17 13:45:03 |只看作者 |坛友微信交流群
我也下载了,谢谢好资料
大方无隅

使用道具

18
zhaopeipei 发表于 2013-9-14 12:33:27 |只看作者 |坛友微信交流群
谢谢楼主分享!

使用道具

19
cbw153053970 学生认证  发表于 2013-9-17 10:07:45 |只看作者 |坛友微信交流群
桌面那个是什么啊!不会用啊,还有工具包调用不上啊,路径设置了matlab就关不掉

使用道具

20
cbw153053970 学生认证  发表于 2013-9-17 10:08:13 |只看作者 |坛友微信交流群
希望楼主详细点演示一下吧

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-26 08:41