SAS中文论坛

标题: 求高人指点NLIN的问题,程序报错,不知道为什么 [打印本页]

作者: shiyiming    时间: 2008-10-26 10:24
标题: 求高人指点NLIN的问题,程序报错,不知道为什么
程序如下:

data stat.ces;
        input l k logq @@;
        cards;
.228        .802        -1.359        .258        .249        -1.695
.821        .771        .193        .767        .511        -.649
.495        .758        -.165        .487        .425        -.270
.678        .452        -.473        .748        .817        .031
.727        .845        -.563        .695        .958        -.125
.458        .084        -2.218        .981        .021        -3.633
.002        .295        -5.586        .429        .277        -.773
.231        .546        -1.315        .664        .129        -1.678
.631        .017        -3.879        .059        .906        -2.301
.811        .223        -1.377        .758        .145        -2.270
.050        .161        -2.539        .823        .006        -5.150
.483        .836        -.324        .682        .521        -.253
.116        .930        -1.530        .440        .495        -.614
.456        .185        -1.151        .342        .092        -2.089
.358        .485        -.951        .162        .934        -1.275
;
run;
proc nlin data=stat.ces;
        parms b0=1 a=-1 d=.5 r=-1;
        lr=l**r;
        kr=k**r;
        z=d*lr+(1-d)*kr;
        model logq=b0+a*log(z);
        der.b0=1;
        der.a=long(z);
        der.d=(a/z)*(lr-kr);
        der.r=(a/z)*(d*log(l)*lr+(1-d)*log(k)*kr);
run;
报错为:
ERROR: Cannot find a library containing subroutine LONG.
ERROR: no dependent variable specified.
作者: shiyiming    时间: 2008-10-26 10:39
标题: Re: 求高人指点NLIN的问题,程序报错,不知道为什么
it's hard to find one thing i know for certain!
it's just a typo. the partial derivative of logq with respect to a is 'log(z)' instead of 'long(z)'.
sorry i may appear too excited, but this world is full of uncertainties! a typo is one of the few only exceptions.
作者: shiyiming    时间: 2008-10-26 10:46
标题: Re: 求高人指点NLIN的问题,程序报错,不知道为什么
Think you very much, you are right .




欢迎光临 SAS中文论坛 (https://mysas.net/forum/) Powered by Discuz! X3.2