I'm experimenting with proc mcmc in SAS EG to build ERS and MRS for MNRM(multidimensional nominal response model). I've referenced the following paper:Using SAS PROC MCMC for Item Response Theory Models Using SAS PROC MCMC for Item Response Theory Models - PMC (nih.gov) My code is below: proc mcmc data=est1 outpost =est_eem_mnrm_postgr seed = 23 nbi=5000 nmc=20000 diagnostics=all plots = all nthreads=-1 DIC; array theta[3]; array c[10,5] c1_1-c1_5 c2_1-c2_5 c3_1-c3_5 c4_1-c4_5 c5_1-c5_5 c6_1-c6_5 c7_1-c7_5 c8_1-c8_5 c9_1-c9_5 c10_1-c10_5; array i[990]; array z[5]; array p[5]; parms c1_2-c1_5 0; parms c2_2-c2_5 0; parms c3_2-c3_5 0; parms c4_2-c4_5 0; parms c5_2-c5_5 0; parms c6_2-c6_5 0; parms c7_2-c7_5 0; parms c8_2-c8_5 0; parms c9_2-c9_5 0; parms c10_2-c10_5 0; c1_1 = -(c1_2+c1_3+c1_4+c1_5); c2_1 = -(c2_2+c2_3+c2_4+c2_5); c3_1 = -(c3_2+c3_3+c3_4+c3_5); c4_1 = -(c4_2+c4_3+c4_4+c4_5); c5_1 = -(c5_2+c5_3+c5_4+c5_5); c6_1 = -(c6_2+c6_3+c6_4+c6_5); c7_1 = -(c7_2+c7_3+c7_4+c7_5); c8_1 = -(c8_2+c8_3+c8_4+c8_5); c9_1 = -(c9_2+c9_3+c9_4+c9_5); c10_1 = -(c10_2+c10_3+c10_4+c10_5); prior c1_2-c1_5 c2_2-c2_5 c3_2-c3_5 c4_2-c4_5 c5_2-c5_5 c6_2-c6_5 c7_2-c7_5 c8_2-c8_5 c9_2-c9_5 c10_2-c10_5 ~normal(0, var=25); random theta1~normal(0,var=1) subject=_obs_; random theta2~normal(0,var=1) subject=_obs_; random theta3~normal(0,var=1) subject=_obs_; llike=0; do m = 1 to 990; i[m] = m; do j = 1 to 10; z[1] =exp((-2)*theta[1]+(1)*theta[2]+(-0.25)*theta[3]+c[j,1]); z[2] =exp((-1)*theta[1]+(-0.67)*theta[2]+(-0.25)*theta[3]+c[j,2]); z[3] =exp((0)*theta[1]+(-0.67)*theta[2]+(1)*theta[3]+c[j,3]); z[4] =exp((1)*theta[1]+(-0.67)*theta[2]+(-0.25)*theta[3]+c[j,4]); z[5] =exp((2)*theta[1]+(1)*theta[2]+(-0.25)*theta[3]+c[j,5]); do k = 1 to 5; p[k] = z[k]/(z1+z2+z3+z4+z5); end; llike = llike+log(p[i[j]]); end; model general(llike); run; Running the above code yields: ERROR: The log-likelihood value is invalid. How can I slove this problem? Many thanks! chichingmui
... View more