|
Data defines the model by dint of genetic programming, producing the best decile table. |
|
SAS Code for Appending a Calculated Column Value Bruce Ratner, PhD |
|

data IN; input x1-x5 3.1; cards; 0.1 0.7 9.1 0.3 0.2 0.0 0.1 2.2 0.7 0.8 0.1 0.2 1.7 0.4 0.5 0.1 0.4 1.8 0.2 0.2 0.1 0.6 4.6 0.8 0.6 0.0 0.2 0.2 1.0 0.2 0.2 0.0 1.0 1.0 0.4 0.1 0.4 1.9 0.7 0.1 0.0 0.8 0.0 0.2 0.3 0.0 0.6 3.3 0.2 0.9 ; run;
data notdotx3; set IN ; if x3 ne . ; run;
proc means data=notdotx3 noprint; var x3; output out=mean_x3 (keep=mean_x3) mean=mean_x3; proc print data=mean_x3;run;
/**** version #1 ****/ data IN_with_avg_x3 (drop=mean_x3); set mean_x3 IN; retain avg_x3; if _n_=1 then avg_x3=mean_x3; if _n_=1 then delete; run; /**** end of version #1 ****/ proc print; run;
/**** version #2 ****/ data mean_x3; set mean_x3; m=1; run;
data IN; set IN; m=1; run;
proc sort data = mean_x3;by m; proc sort data = IN ;by m; run;
data IN_with_mean_x3; merge IN mean_x3; by m; drop m; run; /**** end of version #2 ****/ proc print; 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. |
|
|