I am using Hodges-Lehmann estimator and want to test under Chi-Square (3df). The attached file is the formula of estimator and the distribution. Below is my programming and there are errors when I run it. May I know which parts should I change? PROC IML; **MATRIX CALLED GSMAT**; START GBASMOD(Y,GSMAT) GLOBAL (NX,BOBS); GSMAT = J(2, BOBS, 0); F = 1; M = 0; DO I = 1 TO BOBS; SAMP = NX[I]; L = M + SAMP; TEMP = Y[F:L]; **GETTING GROUP MEDIANS**; /*GSMAT[1,I] = HL – location estimator*/ H=(SAMP)*(SAMP+1)/2; AVG=J(H,1,0); K=0; DO Z=1 TO SAMP; DO J=1 TO SAMP; IF Z<=J THEN DO; K=K+1; AVG[K,]=(TEMP[Z]+TEMP[J])/2; END; END; GSMAT[1,I] = MEDIAN(AVG); END; ****GENERATE DATA FOR CONDITIONS****; *PRINT 'NSIM STAT PVAL '; DO K = 1 TO 1000000; IF F = 1 THEN TEMP=RANNOR(J(1000000,3,439839383)); NX[I] = TEMP[##,]; END; RUN PRINT 'NSIM STAT PVAL’; NAMES1 = {"Estimate"};
... View more