options ls=80; options formdlim='-'; *edit the path below for your file location; filename name 'C:\Users\decar\Desktop\Ennis_3AFC\Ennis_ss.txt'; DATA first; infile name delimiter=' ' firstobs=2; input x y z z1 z2; trial=_N_; resp=1; if y=1 then i1=1; if y=1 then i2=0; if y=1 then i3=0; if y=2 then i1=0; if y=2 then i2=1; if y=2 then i3=0; if y=3 then i1=0; if y=3 then i2=0; if y=3 then i3=1; output; keep trial x y resp z z1 z2 i1 i2 i3; RUN; proc nlmixed data=first qpoints=11; parms b1-b2=0 d=0; eta1 = (b1-b2+d*z+eps1)*i1+(-b1+b2-d*z+eps2)*i2+(-b1+d*z1+eps3)*i3; eta2 = (b1-d*z1+eps1)*i1+(b2-d*z2+eps2)*i2+(-b2+d*z2+eps3)*i3; p = probnorm(eta1)*probnorm(eta2); model resp ~ binary(p); random eps1 eps2 eps3 ~ normal([0,0,0],[1,0,1,0,0,1]) SUBJECT=trial; predict p out=predprob; ods output parameterestimates=subjparm; run;