Hi PGStats and all, I need to modify the codes above to create a combined binary variable beta1_beta2 with y1 and y2 this time. I was wondering if you can advise me how to modify the previous SAS codes please? data have;
infile "&sasforum\datasets\wiedat2b.csv" firstobs=2 dsd;
input y1 y2 kyphosis;
run;
DATA have;
set have;
********Creating the first binary variable beta1 with y1=28;
if y1 <= 28 then beta1=0;
else beta1=1;
**Creating the first binary variable beta2 with y2=13.3;
if y2 <=13.3 then beta2=0;
else beta2=1;
********Creating the first combined binary variable beta1_beta2 with the pair (y1=28,y2=13.3);
if beta1=1 & beta2=1 then beta1_beta2=1;
if beta1=1 & beta2=0 then beta1_beta2=1;
if beta1=0 & beta2=1 then beta1_beta2=1;
if beta1=0 & beta2=0 then beta1_beta2=0;
run;
proc freq data = have order=data noprint ;
tables beta1_beta2*kyphosis / out=FreqCount OUTPCT sparse ;
*output out=mnocol;
run;
*THEN REPEAT FOR: y1=28, y2=11.1, 12.6, ect...;
***Do the same for the second paire y1=28,y2=11.1;
***Do the same for the second paire y1=28,y2=12.6;
**........;
***Do the same for the last (141) paire y1=28,y2=14.2;
**THEN REPEAT FOR: y1=16.7, y2=11.1, 12.6, ect...;
***Do the same for the second paire y1=16.7,y2=11.1;
***Do the same for the second paire y1=16.7,y2=12.6;
**........;
***Do the same for the last (141) paire y1=16.7,y2=14.2;
****HOW TO REPEAT THIS FROCESS FOR ALL 19881 COMBINATION IN THE DATASET (141 X 141 POSSIBLE COMBINATIONS)
... View more