楼主: bigbin
15112 6

[问答] 运行结果老是显示未定义与 'struct' 类型的输入参数相对应的函数 'sar_panel'。 [推广有奖]

  • 0关注
  • 0粉丝

本科生

61%

还不是VIP/贵宾

-

威望
0
论坛币
20 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
177 点
帖子
18
精华
0
在线时间
189 小时
注册时间
2005-9-7
最后登录
2017-3-10

100论坛币
运行结果老是显示未定义与 'struct' 类型的输入参数相对应的函数 'sar_panel'。
都弄了两天了还没出来,现在学校没什么人,也没人可以请教。下面是我的
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);
未定义与 'struct' 类型的输入参数相对应的函数 'sar_panel'。

我试试其他的Ssem-panel也不行,可是我help sar 可以显示出sar程序的。

关键词:struct Panel pane SAR TRU 悬赏100币求助 小弟论坛币不多 勿怪
沙发
matlab-007 发表于 2016-8-27 21:00:16 |只看作者 |坛友微信交流群
没有定义双精度型变量u,必须在类定义前面添加:
           double u;

使用道具

藤椅
onlyayy 发表于 2016-9-2 00:37:54 |只看作者 |坛友微信交流群
请问楼主解决了吗
我也出现了类似问题
经常出现   未定义与 'struct' 类型的输入参数相对应的函数 'prt_sp'。 不知道为何

使用道具

板凳
王伟铭23 学生认证  发表于 2017-4-23 19:23:40 |只看作者 |坛友微信交流群
楼主请问你解决这个问题了吗

使用道具

报纸
王伟铭23 学生认证  发表于 2017-4-25 20:57:50 |只看作者 |坛友微信交流群
onlyayy 发表于 2016-9-2 00:37
请问楼主解决了吗
我也出现了类似问题
经常出现   未定义与 'struct' 类型的输入参数相对应的函数 'prt ...
你好,请问你解决这问题了吗

使用道具

地板
jaguar_zhang 发表于 2018-4-13 09:31:59 |只看作者 |坛友微信交流群
我也遇到同样问题,有哪位大牛出来帮忙解释下啊。

使用道具

7
心怡heart-one 在职认证  发表于 2019-3-1 19:40:38 |只看作者 |坛友微信交流群
把你需要的所有函数都添加的路径中来,可以打开这个函数运行来看看判断是否添加成功了。

微信图片_20190301172007.png (167.96 KB)

微信图片_20190301172007.png

使用道具

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

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

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

GMT+8, 2024-4-19 10:52