EP_FPPA
). To calculate it, we need to compare the subject's bid (b8_1, b8_2, b8_3) with the average of other's bid (meanb8_1, meanb8_2, meanb8_3). The tip is from http://scott.sherrillmix.com/blog/programmer/sas-macros/Here I extend to the case of three variables.
/*---------Example---------*/
proc means data=label.FPPA mean;/*test of the macro*/
var b8_1 b8_2 b8_3;
output out=label.lablemeanb8_1 mean=meanb8_1 meanb8_2 meanb8_3;
run;
data _null_;
set label.lablemeanb8_1;
call symput('meanbid8_1',trim(left(meanb8_1)));
call symput('meanbid8_2',trim(left(meanb8_2)));
call symput('meanbid8_3',trim(left(meanb8_3)));
run;
data label.FPPA;
set label.FPPA;
if b8_1> &meanbid8_1 then EP_FPPA1=b8_4- b8_1; else EP_FPPA1=0;
/*&meanbid8_1 is to call the value restored*/
if b8_2> &meanbid8_2 then EP_FPPA1=b8_5- b8_2; else EP_FPPA1=0;
if b8_3> &meanbid8_3 then EP_FPPA1=b8_6- b8_3; else EP_FPPA1=0;
run;


雷达卡


京公网安备 11010802022788号







