
372 Statistical Programming in SAS
Display 10.15 (continued)
MPRINT(TRAP_AREA_Z): low = 0;
MPRINT(TRAP_AREA_Z): high = 1.96;
MPRINT(TRAP_AREA_Z): incr = (high-low)/( 10 -1);
MPRINT(TRAP_AREA_Z): pi = arcos(-1);
MPRINT(TRAP_AREA_Z): do i= 1 to 10;
MPRINT(TRAP_AREA_Z): x_value[i] = low + incr*(i-1);
MPRINT(TRAP_AREA_Z): f_value[i] = (1/sqrt(2*pi))*exp(-x_value[i]*x_value[i]/2);
MPRINT(TRAP_AREA_Z): if i=1 or i=10 then trapsum = trapsum + f_value[i]/2;
MPRINT(TRAP_AREA_Z): else trapsum = trapsum + f_value[i];
MPRINT(TRAP_AREA_Z): end;
MPRINT(TRAP_AREA_Z): area_est = trapsum*incr;
MPRINT(TRAP_AREA_Z): output;
MPRINT(TRAP_AREA_Z): put "est. P(0 ...