Here is a sample data set and solution. It works for me. Try it out:
data run1;
input subject treatment diagnosis;
datalines;
1 0 1
2 1 0
3 0 0
4 0 1
5 1 0
6 1 1
7 0 1
8 1 0
9 0 0
;
data newrun1;
set run1;
if treatment=0 and diagnosis=0 then group8=1;
else if treatment=0 and diagnosis=1 then group8=2;
else if treatment=1 and diagnosis=0 then group8=3;
else if treatment=1 and diagnosis=1 then group8=4;
run;
proc print; run;
Most likely, the problem is your data. Either your input data set doesn't have the variables Treatment and Diagnosis (check your spelling!) or those variables do not have the values you think they do. Use the following to examine the values of your variables:
proc freq data=run1;
tables treatment * diagnosis / norow nocol nopercent;
run;
... View more