I am getting the following error message, any help is appreciated: ERROR: (execution) Character argument should be numeric. operation : QUAD at line 6707 column 5 operands : *LIT1021, INTERVAL *LIT1021 1 row 1 col (character, size 6) TLAINT INTERVAL 1 row 2 cols (character, size 2) H K1 statement : CALL at line 6707 column 5 traceback : module KBETAFIND at line 6707 column 5 Below is the code: PROC IML; START TLAINT(U) GLOBAL(N1,NMAX,Z1,C,ZBETA); /*THIS MODULE CREATES THE INTEGRAND TO BE SOLVED;*/ Z1 = J(1,1,.); TEMP = Z1[1,1]*SQRT((N1+NMAX)/N1)-C; ZB = TEMP><ZBETA; AA1 = C*(C+ZB)-U**2; AA2 = SQRT((C+ZB)**2-U**2); ARG = AA1/AA2; YY1 = CDF("NORMAL",ARG); YY = YY1*PDF("NORMAL",U); RETURN(YY); FINISH TLAINT; START KBETAFIND(A) GLOBAL(N1,NMAX,C,ZBETA,H,ALPHA,Z1); /*THIS MODULE SOLVES K AND ZBETA GIVEN N1,NMAX, C AND ZBETA;*/ ALPHA = 0.025; C = J(1,1,.); KMAX = J(1,1,.); K = A[1]; ZBETA = A[2]; KMAX = C+ZBETA; K1 = MIN(K,KMAX); INTERVAL = {H K1}; CALL QUAD(INT,"TLAINT", INTERVAL); FUTILE = 1 - CDF("NORMAL",H); FF = INT - (FUTILE - ALPHA); RETURN (FF); FINISH KBETAFIND; START PWRCAL(Z1) GLOBAL(C,ZBBTA,N1,NMAX,N2,DELTA,S); /*THIS MODULE CREATES THE INTEGRAND TO CALCULATE UNCONDITIONAL POWER;*/ /*WILL NEED TO BE CALLED IN WITHIN DO LOOP*/ ZBBTA=ZZ_; S = SQRT(2/N1); N2 = ((((C+ZBBTA)**2)/(Z1**2) -1)*N1)><NMAX; CPARG = (C*SQRT(N1+N2) - Z1*SQRT(N1) - N2*DELTA/SQRT(2))/SQRT(N2); PWRARG = (1-CDF("NORMAL",CPARG))*PDF("NORMAL",Z1-DELTA/S); RETURN PWRARG; FINISH PWRCAL; HH = T(DO(.7,1.2,(1.2-.7)/49)); NMAX_=J(NROW(HH),1,.); UNP =J(NROW(HH),1,.); CPOWER =J(NROW(HH),1,.); NTMAX = 192; DO I = 1 TO NROW(HH); H = HH[I,1]; FUTILE = 1 - CDF("NORMAL",H); N1 = 40; NMAX = NTMAX - N1; NMAX_ = NMAX; DO WHILE (UNP<0.8); N1 = N1+1; S = SQRT(2/N1); NMAX= NTMAX - N1; NMAX_ = NMAX; OPTN = {2,4}`; CALL NLPTR(RC,XR,"KBETAFIND",{2, 0.8}`,OPTN) ; KVAL = XR[1]; ZBBTA = XR[2]; CALL QUAD(INT,"PWRCAL",HH[I,1]||KVAL); UNP = CDF("NORMAL",DELTA/S - KVAL) + INT; END; NS1 = N1; START EXPN(Z1) GLOBAL(NS1,C,ZBBTA,NMAX,DELTA); S = SQRT(2/NS1); EN_ = ((((C+ZBBTA)**2)/(Z1**2) -1)*NS1)><NMAX; F = EN_*PDF("NORMAL",Z1-DELTA/S); FINISH EXPN; CALL QUAD(ENINT,"EXPN",HH[I,1]||KVAL); EN = NS1 + ENINT; CPOWER = CDF("NORMAL",ZBBTA); PRINT "ITERATION" I; END; CREATE FINAL VAR{HH,KVAL,CPOWER,NS1,EN,NMAX_}; APPEND; CLOSE FINAL; QUIT;
... View more