楼主: skydeeye
3325 4

[回归分析求助] 关于错误verify that nlsurmytrans is a function evaluator program谁遇到过求帮助! [推广有奖]

  • 0关注
  • 1粉丝

硕士生

70%

还不是VIP/贵宾

-

威望
0
论坛币
172 个
通用积分
14.4779
学术水平
0 点
热心指数
0 点
信用等级
1 点
经验
5902 点
帖子
137
精华
0
在线时间
215 小时
注册时间
2012-5-2
最后登录
2021-5-18

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
这是一段开头
capture program drop nlsurmytrans   
  program nlsurmytrans   
     version 10
     syntax varlist(min=8 max=8) [if], at(name)
     tokennize `varlist'
     args lnca sl sk y pl pk pe t
tempname z0
scalar `z0'=`at'[1,1]
tempname z1 z2 z3
scalar `z1'=`at'[1,2]
scalar `z2'=`at'[1,3]
scalar `z3'=1-`z1'-`z2'
程序似乎运行到第5行就中止了
下面是报错的

  = qui gen double __00000E = sl if __000002
  - local alljunk `alljunk' `junk`i''
  = local alljunk __00000D __00000E
  - }
  - tempvar junk`i'
  = tempvar junk3
  - qui gen double `junk`i'' = `yname`i'' if `touse'
  = qui gen double __00000F = sk if __000002
  - local alljunk `alljunk' `junk`i''
  = local alljunk __00000D __00000E __00000F
  - }
  - if "`options'" != "" {
  = if "" != "" {
    capture nlsur`eqn' `alljunk' `t23rhs' `wtexp' if `touse', `options' at(`parmvec')
    }
  - else {
  - capture nlsur`eqn' `alljunk' `t23rhs' `wtexp' if `touse', at(`parmvec')
  = capture nlsurmytrans __00000D __00000E __00000F y pl pk pe t  if __000002, at(__000003)
    --------------------------------------------------------------------------------------------- begin nlsurmytrans ------
    - version 10
    - syntax varlist(min=8 max=8 numeric ts) [if], at(name)
    - tokennize `varlist'
    = tokennize __00000D __00000E __00000F y pl pk pe t
    ----------------------------------------------------------------------------------------------- end nlsurmytrans ------
  - }
  - if _rc {
  - di as error "nlsur`eqn' returned " _rc
  = di as error "nlsurmytrans returned " _rc
nlsurmytrans returned 199
  - di as error "verify that nlsur`eqn' is a function evaluator program"
  = di as error "verify that nlsurmytrans is a function evaluator program"
verify that nlsurmytrans is a function evaluator program
  - exit _rc
    }
    }
  ----------------------------------------------------------------------------------------------- end nlsur.Estimate ------
---------------------------------------------------------------------------------------------------------- end nlsur ------
r(199);

二维码

扫码加我 拉你入群

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

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

关键词:Evaluator function Program verify NLSUR function verify

沙发
skydeeye 发表于 2013-7-3 19:00:11 |只看作者 |坛友微信交流群
我把保存的nlsurmytans.do文件删掉再运行还能出现以上报错,是什么原因?

使用道具

藤椅
whgyu 发表于 2013-7-3 19:01:14 |只看作者 |坛友微信交流群
tokennize 多打了个n

使用道具

板凳
skydeeye 发表于 2013-7-3 19:48:41 |只看作者 |坛友微信交流群
whgyu 发表于 2013-7-3 19:01
tokennize 多打了个n
太感谢您了,改了之后能运行多一点,但是又出现了以下错误,是因为我没设置初始值吗?
    - quietly{
        - replace `lnca'=`z0'+`z4'*ln(`y')+0.5*`z44'*(ln(`y'))^2+`z14'*ln(`y')*ln(`k1'*`pl')+`z24'*ln(`y')*ln(`k2'*`pk')
> +`z34'*ln(`y')*ln(`k3'*`pe')+`z1'*ln(`k1'*`pl')+`z2'*ln(`k2'*`pk')+`z3'*ln(`k3'*`pe')+0.5*`z11'*(ln(`k1'*`pl'))^2+0.5*
> `z22'*(ln(`k2'*`pk'))^2+0.5*`z33'*(ln(`k3'*`pe'))^2+`z12'*ln(`k1'*`pl')*ln(`k2'*`pk')+`z13'*ln(`k1'*`pl')*ln(`k3'*`pe'
> )+`z23'*ln(`k2'*`pk')*ln(`k3'*`pe')+`z15'*ln(`k1'*`pl')*`t'+`z25'*ln(`k2'*`pk')*`t'+`z35'*ln(`k3'*`pe')*`t'+`z5'*`t'+0
> .5*`z55'*`t'^2+`z45'*ln(`y')*`t'+ln((`z1'+`z15'*`t'+`z11'*ln(`k1'*`pl')+`z12'*ln(`k2'*`pk')+`z13'*ln(`k3'*`pe')+`z14'*
> ln(`y'))/`k1'+(`z2'+`z25'*`t'+`z12'*ln(`k1'*`pl')+`z22'*ln(`k2'*`pk')+`z23'*ln(`k3'*`pe')+`z24'*ln(`y'))/`k2'+(`z3'+`z
> 35'*`t'+`z13'*ln(`k1'*`pl')+`z32'*ln(`k2'*`pk')+`z33'*ln(`k3'*`pe')+`z34'*ln(`y'))/`k3')+ln(1/`b') `if'
        = replace __00000G=__00002I+__000035*ln(y)+0.5*__000038*(ln(y))^2+__00002M*ln(y)*ln(__000031*pl)+__00002N*ln(y)*
> ln(__000032*pk)+__00002O*ln(y)*ln(__000033*pe)+__00002J*ln(__000031*pl)+__00002K*ln(__000032*pk)+__00002L*ln(__000033*
> pe)+0.5*__00002S*(ln(__000031*pl))^2+0.5*__00002W*(ln(__000032*pk))^2+0.5*__000030*(ln(__000033*pe))^2+__00002T*ln(__0
> 00031*pl)*ln(__000032*pk)+__00002U*ln(__000031*pl)*ln(__000033*pe)+__00002X*ln(__000032*pk)*ln(__000033*pe)+__00002P*l
> n(__000031*pl)*t+__00002Q*ln(__000032*pk)*t+__00002R*ln(__000033*pe)*t+__000036*t+0.5*__000039*t^2+__000037*ln(y)*t+ln
> ((__00002J+__00002P*t+__00002S*ln(__000031*pl)+__00002T*ln(__000032*pk)+__00002U*ln(__000033*pe)+__00002M*ln(y))/__000
> 031+(__00002K+__00002Q*t+__00002T*ln(__000031*pl)+__00002W*ln(__000032*pk)+__00002X*ln(__000033*pe)+__00002N*ln(y))/__
> 000032+(__00002L+__00002R*t+__00002U*ln(__000031*pl)+__00002Z*ln(__000032*pk)+__000030*ln(__000033*pe)+__00002O*ln(y))
> /__000033)+ln(1/__000034) if __000002
        - replace `sl'=((`z1'+`z15'*`t'+`z11'*ln(`k1'*`pl')+`z12'*ln(`k2'*`pk')+`z13'*ln(`k3'*`pe')+`z14'*ln(`y'))/`k1')
> /((`z1'+`z15'*`t'+`z11'*ln(`k1'*`pl')+`z12'*ln(`k2'*`pk')+`z13'*ln(`k3'*`pe')+`z14'*ln(`y'))/`k1'+(`z2'+`z25'*`t'+`z12
> '*ln(`k1'*`pl')+`z22'*ln(`k2'*`pk')+`z23'*ln(`k3'*`pe')+`z24'*ln(`y'))/`k2'+(`z3'+`z35'*`t'+`z31'*ln(`k1'*`pl')+`z32'*
> ln(`k2'*`pk')+`z33'*ln(`k3'*`pe')+`z34'*ln(`y'))/`k3') `if'
        = replace __000011=((__00002J+__00002P*t+__00002S*ln(__000031*pl)+__00002T*ln(__000032*pk)+__00002U*ln(__000033*
> pe)+__00002M*ln(y))/__000031)/((__00002J+__00002P*t+__00002S*ln(__000031*pl)+__00002T*ln(__000032*pk)+__00002U*ln(__00
> 0033*pe)+__00002M*ln(y))/__000031+(__00002K+__00002Q*t+__00002T*ln(__000031*pl)+__00002W*ln(__000032*pk)+__00002X*ln(_
> _000033*pe)+__00002N*ln(y))/__000032+(__00002L+__00002R*t+__00002Y*ln(__000031*pl)+__00002Z*ln(__000032*pk)+__000030*l
> n(__000033*pe)+__00002O*ln(y))/__000033) if __000002
        - replace `sk'=((`z2'+`z25'*`t'+`z12'*ln(`k1'*`pl')+`z22'*ln(`k2'*`pk')+`z23'*ln(`k3'*`pe')+`z24'*ln(`y'))/`k2')
> /((`z1'+`z15'*`t'+`z11'*ln(`k1'*`pl')+`z12'*ln(`k2'*`pk')+`z13'*ln(`k3'*`pe')+`z14'*ln(`y'))/`k1'+(`z2'+`z25'*`t'+`z12
> '*ln(`k1'*`pl')+`z22'*ln(`k2'*`pk')+`z23'*ln(`k3'*`pe')+`z24'*ln(`y'))/`k2'+(`z3'+`z35'*`t'+`z31'*ln(`k1'*`pl')+`z32'*
> ln(`k2'*`pk')+`z33'*ln(`k3'*`pe')+`z34'*ln(`y'))/`k3') `if'
        = replace __00001M=((__00002K+__00002Q*t+__00002T*ln(__000031*pl)+__00002W*ln(__000032*pk)+__00002X*ln(__000033*
> pe)+__00002N*ln(y))/__000032)/((__00002J+__00002P*t+__00002S*ln(__000031*pl)+__00002T*ln(__000032*pk)+__00002U*ln(__00
> 0033*pe)+__00002M*ln(y))/__000031+(__00002K+__00002Q*t+__00002T*ln(__000031*pl)+__00002W*ln(__000032*pk)+__00002X*ln(_
> _000033*pe)+__00002N*ln(y))/__000032+(__00002L+__00002R*t+__00002Y*ln(__000031*pl)+__00002Z*ln(__000032*pk)+__000030*l
> n(__000033*pe)+__00002O*ln(y))/__000033) if __000002
        - }
        ------------------------------------------------------------------------------------------- end nlsurmytrans ---
      - }
      --------------------------------------------------------------------------------------- end nlsur.FunctionEval ---
    - forvalues i = 1/$NLS_neqn {
    = forvalues i = 1/3 {
    - capture assert ${NLS_yhat`i'} < . if `touse'
    = capture assert __00000G < . if __000002
    - if _rc {
    - noi di in red "could not evaluate equation `i'"
    = noi di in red "could not evaluate equation 1"
could not evaluate equation 1
    - noi di in red "starting values invalid or some RHS variables have missing values"
starting values invalid or some RHS variables have missing values
    - exit 480
      }
      qui replace ${NLS_resid`i'} = ${NLS_yname`i'} - ${NLS_yhat`i'} if `touse'
      }
    ----------------------------------------------------------------------------------------------- end nlsur.MinSSQ ---
  ----------------------------------------------------------------------------------------------- end nlsur.Estimate ---
---------------------------------------------------------------------------------------------------------- end nlsur ---
r(480);


使用道具

报纸
skydeeye 发表于 2013-7-3 19:50:48 |只看作者 |坛友微信交流群
whgyu 发表于 2013-7-3 19:01
tokennize 多打了个n
这是三个需要估计参数的方程。
quietly{
replace `lnca'=`z0'+`z4'*ln(`y')+0.5*`z44'*(ln(`y'))^2+`z14'*ln(`y')*ln(`k1'*`pl')+`z24'*ln(`y')*ln(`k2'*`pk')+`z34'*ln(`y')*ln(`k3'*`pe')+`z1'*ln(`k1'*`pl')+`z2'*ln(`k2'*`pk')+`z3'*ln(`k3'*`pe')+0.5*`z11'*(ln(`k1'*`pl'))^2+0.5*`z22'*(ln(`k2'*`pk'))^2+0.5*`z33'*(ln(`k3'*`pe'))^2+`z12'*ln(`k1'*`pl')*ln(`k2'*`pk')+`z13'*ln(`k1'*`pl')*ln(`k3'*`pe')+`z23'*ln(`k2'*`pk')*ln(`k3'*`pe')+`z15'*ln(`k1'*`pl')*`t'+`z25'*ln(`k2'*`pk')*`t'+`z35'*ln(`k3'*`pe')*`t'+`z5'*`t'+0.5*`z55'*`t'^2+`z45'*ln(`y')*`t'+ln((`z1'+`z15'*`t'+`z11'*ln(`k1'*`pl')+`z12'*ln(`k2'*`pk')+`z13'*ln(`k3'*`pe')+`z14'*ln(`y'))/`k1'+(`z2'+`z25'*`t'+`z12'*ln(`k1'*`pl')+`z22'*ln(`k2'*`pk')+`z23'*ln(`k3'*`pe')+`z24'*ln(`y'))/`k2'+(`z3'+`z35'*`t'+`z13'*ln(`k1'*`pl')+`z32'*ln(`k2'*`pk')+`z33'*ln(`k3'*`pe')+`z34'*ln(`y'))/`k3')+ln(1/`b') `if'
replace `sl'=((`z1'+`z15'*`t'+`z11'*ln(`k1'*`pl')+`z12'*ln(`k2'*`pk')+`z13'*ln(`k3'*`pe')+`z14'*ln(`y'))/`k1')/((`z1'+`z15'*`t'+`z11'*ln(`k1'*`pl')+`z12'*ln(`k2'*`pk')+`z13'*ln(`k3'*`pe')+`z14'*ln(`y'))/`k1'+(`z2'+`z25'*`t'+`z12'*ln(`k1'*`pl')+`z22'*ln(`k2'*`pk')+`z23'*ln(`k3'*`pe')+`z24'*ln(`y'))/`k2'+(`z3'+`z35'*`t'+`z31'*ln(`k1'*`pl')+`z32'*ln(`k2'*`pk')+`z33'*ln(`k3'*`pe')+`z34'*ln(`y'))/`k3') `if'        
replace `sk'=((`z2'+`z25'*`t'+`z12'*ln(`k1'*`pl')+`z22'*ln(`k2'*`pk')+`z23'*ln(`k3'*`pe')+`z24'*ln(`y'))/`k2')/((`z1'+`z15'*`t'+`z11'*ln(`k1'*`pl')+`z12'*ln(`k2'*`pk')+`z13'*ln(`k3'*`pe')+`z14'*ln(`y'))/`k1'+(`z2'+`z25'*`t'+`z12'*ln(`k1'*`pl')+`z22'*ln(`k2'*`pk')+`z23'*ln(`k3'*`pe')+`z24'*ln(`y'))/`k2'+(`z3'+`z35'*`t'+`z31'*ln(`k1'*`pl')+`z32'*ln(`k2'*`pk')+`z33'*ln(`k3'*`pe')+`z34'*ln(`y'))/`k3') `if'
}

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

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

GMT+8, 2024-11-5 19:29