Re: help on a sas program



It says that it's expecing an semicolon.

"hi" <jinyinglu@xxxxxxxxxxx> wrote in message
news:1157890513.481404.253050@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dear all,

I have wrote a SAS program listed below, however, there have an error
with the problem of "75 zj=(kj-tt)*term;
--
22
76
ERROR 22-322: Expecting ;.
ERROR 76-322: Syntax error, statement will be ignored.
"

I do not know how to debug it. If you have time, please kindly go
through it and give me some advice. thanks in advance.



/* SAS code to fit the normal model for multiple-alternative rating
*data in terms of equation (where is the *cumulative probability
for each of the 5 categories at the combination *level X.)
*/


/* rp=nr/nt: the observed response probability
* nr: the frequency of a response category
* nt: total number of responses in condition
* categ: the category of the response
* x1 x2 x3: the independent variable
*/


data a;
input rp nr nt categ x1 x2 x3;
cards;

0.586956522 27 46 1 0 0 0
0.181818182 4 22 1 1 0 0
0.428571429 6 14 1 0 1 0
0 0 9 1 1 1 1
0.369565217 17 46 2 0 0 0
0.045454545 1 22 2 1 0 0
0.357142857 5 14 2 0 1 0
0.222222222 2 9 2 1 1 1
0.043478261 2 46 3 0 0 0
0.090909091 2 22 3 1 0 0
0.142857143 2 14 3 0 1 0
0 0 9 3 1 1 1
0 0 46 4 0 0 0
0.090909091 2 22 4 1 0 0
0.071428571 1 14 4 0 1 0
0.222222222 2 9 4 1 1 1
0 0 46 5 0 0 0
0.590909091 13 22 5 1 0 0
0 0 14 5 0 1 0
0.555555556 5 9 5 1 1 1
run;

proc nlin method=dud;
parameters c1=-1 d1=0.6 d2=0.5 d3=0.7 a1=2.5 a2=0.2 a3=-0.7 b1=-1.8
b2=-0.4 b3=1.3;

/* set distances between cutoff values to be positive*/
BOUNDS d1>0, d2>0, d3>0;

term=exp(b1*(x1-0.5)+b2(x2-0.5)+b3(x3-0.25));
tt=a1*(x1-0.5)+a2*(x2-0.5)+a3(x3-0.25);

/*model response prob. Of category one*/

if (categ=1) then do;
zj=(c1-tt)*term;
model rp=probnorm(zj);
/*probnorm returns cumulative normal prob.*/

end;

/* model response prob. Of category 2 to next to last: express cutoffs
by initial cutoff and the distances between successive cutoffs */


if (categ >1 and categ<5) then do;
if (categ=2) then do;
kj=c1+d1;
ko=c1;
end;

if (categ=3) then do;
kj=c1+d1+d2;
ko=c1+d1;
end;

if(categ=4) then do;
kj=c1+d1+d2+d3;
ko=c1+d1+d2;
end
zj=(kj-tt)*term;
zo=(ko-tt)*term;
pj=probnorm(zj);
po=probnorm(zo);
model rp=pj-po;

end;

/* model prob. Of the last response category */

if (categ=5) then do;
zj=(c1+d1+d2+d3-tt)*term;
model rp=1-probnorm(zj);
end;

/* generalized inverse of multinomial covariances */

_WEIGHT_=nt/model.rp;

dev=-2*nr*log(model.rp);

if(rp>0 and rp<1) then dev=dev+2*nr*log(rp);

/* replace prob nlin default weighted loss function by deviance*/
_LOSS_=dev/_WEIGHT_;

pr=model.rp;

run;

/*program ends*/



.



Relevant Pages

  • help on a sas program
    ... Syntax error, statement will be ignored. ... the frequency of a response category ... categ: ... Of category 2 to next to last: express cutoffs ...
    (sci.stat.edu)
  • Re: help on a sas program
    ... I have wrote a SAS program listed below, however, there have an error ... the frequency of a response category ... categ: ... Of category 2 to next to last: express cutoffs ...
    (sci.stat.edu)
  • help on a sas program
    ... I have wrote a sas program recently. ... the frequency of a response category ... categ: ... Of category 2 to next to last: express cutoffs ...
    (sci.stat.math)
  • Re: help on a sas program
    ... I suggest changing the method from DUD to GAUSS in your PROC NLIN statement. ... the frequency of a response category ... categ: ... Of category 2 to next to last: express cutoffs ...
    (sci.stat.math)
  • Re: help on a sas program
    ... I suggest changing the method from DUD to GAUSS in your PROC NLIN ... I have wrote a sas program recently. ... the frequency of a response category ... Of category 2 to next to last: express cutoffs ...
    (sci.stat.math)

Loading