|
Data defines the model by dint of genetic programming, producing the best decile table.
|
|
SAS Code for Finding Mid-Spread of Two Variables Bruce Ratner, PhD |
|
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %let spread=50;
data IN; do id=1 to 120; x1 = (rannor(2345)+100)*5000; x2 = (rannor(2345)+5)*10; output; end; run;
proc rank data=IN groups=100 out=OUT; var x1 x2; ranks x1r x2r; run; proc print data=OUT; title 'ranks of OUT'; run;
data middle50x1; set out; rhp=(100-&spread)/2; if x1r=> (rhp-1) and x1r<=(99-rhp); keep id x1 x1r; run; proc print data=middle50x1; title ' mid-spread of x1 '; run;
data middle50x2; set out; rhp=(100-&spread)/2; if x2r=> (rhp-1) and x2r<=(99-rhp); keep id x2 x2r; run; proc print data=middle50x2; title ' mid-spread of x2 '; run; proc sort data=middle50x1;by id; run; proc sort data=middle50x2;by id; run;
data mid_spread_x1_x2; merge middle50x1 (in=var_x1) middle50x2 (in=var_x2); by id; if var_x1=1 and var_x2=1; run;
proc print data=Mid_Spread_x1_x2; title' mid_spread_x1_x2 '; run;
|
For more information about this article, call Bruce Ratner at 516.791.3544 or 1 800 DM STAT-1; or e-mail at br@dmstat1.com. |
Sign-up for a free GenIQ webcast: Click here. |
|
|