全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
15886 6
2016-01-25
悬赏 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程序的。
二维码

扫码加我 拉你入群

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

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

全部回复
2016-8-27 21:00:16
没有定义双精度型变量u,必须在类定义前面添加:
           double u;
二维码

扫码加我 拉你入群

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

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

2016-9-2 00:37:54
请问楼主解决了吗
我也出现了类似问题
经常出现   未定义与 'struct' 类型的输入参数相对应的函数 'prt_sp'。 不知道为何
二维码

扫码加我 拉你入群

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

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

2017-4-23 19:23:40
楼主请问你解决这个问题了吗
二维码

扫码加我 拉你入群

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

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

2017-4-25 20:57:50
onlyayy 发表于 2016-9-2 00:37
请问楼主解决了吗
我也出现了类似问题
经常出现   未定义与 'struct' 类型的输入参数相对应的函数 'prt ...
你好,请问你解决这问题了吗
二维码

扫码加我 拉你入群

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

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

2018-4-13 09:31:59
我也遇到同样问题,有哪位大牛出来帮忙解释下啊。
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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