楼主: 余可
9750 15

[问答] 用Matlab运算空间面板数据时出现了results structure not known by prt_sp function [推广有奖]

  • 0关注
  • 0粉丝

初中生

0%

还不是VIP/贵宾

-

威望
0
论坛币
4382 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
185 点
帖子
10
精华
0
在线时间
11 小时
注册时间
2009-3-9
最后登录
2018-3-4

楼主
余可 发表于 2012-2-11 11:08:09 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
请问哪位高手能帮忙解决这一错误,在下不胜感激!
二维码

扫码加我 拉你入群

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

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

关键词:Structure function results struct Result Error result function 空间 面板

沙发
余可 发表于 2012-2-11 11:11:15
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

藤椅
阳光绒绒 发表于 2012-3-31 10:08:34
我也出现了你这个问题,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
调试很久都没解决,后来发现是因为命令后期改进了,prt_sp原来是6kb,新下的是11kb,你试试这个应该没问题

prt_sp.rar
下载链接: https://bbs.pinggu.org/a-1080009.html

2.09 KB

本附件包括:

  • prt_sp.m

板凳
阳光绒绒 发表于 2012-3-31 10:09:37
怎么把你的命令复制下来了~~不好意思,中间略过

报纸
huajun7788 发表于 2012-7-20 17:25:32
楼上的好,我的matlab怎么运行不了LMsarsem_panel,提示有问题,其他的如moran检验没有问题
怎么回事,是不是jplv7包中没有呀

地板
mingmeisdd 发表于 2013-6-20 09:46:05
阳光绒绒 发表于 2012-3-31 10:09
怎么把你的命令复制下来了~~不好意思,中间略过
大侠,请教您个问题,我在运行空间效应sarar模型时也出现了和楼主同样的问题,我将您分享的prt_sp.rar下载下来了,运行时还是出现以前的问题,这是怎么回事呢?

7
黑白电视机 发表于 2013-6-24 22:55:46
mingmeisdd 发表于 2013-6-20 09:46
大侠,请教您个问题,我在运行空间效应sarar模型时也出现了和楼主同样的问题,我将您分享的prt_sp.rar下载 ...
应该是由于参数个数不对应,你检查一下是否包含constant 然后变量个数是否和前面定义的一致
难得糊涂

8
lvzhp06 发表于 2014-6-27 15:40:32
mingmeisdd 发表于 2013-6-20 09:46
大侠,请教您个问题,我在运行空间效应sarar模型时也出现了和楼主同样的问题,我将您分享的prt_sp.rar下载 ...
请问你怎么运行的sarar模型的,工具箱里面没有这个函数吧。

9
matlab-007 发表于 2015-2-26 11:07:58
运行后 会有提示 请选择 add path 试试

10
jerrybian 发表于 2015-3-11 21:10:49
huajun7788 发表于 2012-7-20 17:25
楼上的好,我的matlab怎么运行不了LMsarsem_panel,提示有问题,其他的如moran检验没有问题
怎么回事,是不 ...
请问你moran检验,用的是哪个文件?工具箱里有moran检验的相关程序吗。谢谢!!

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-16 15:05