filename ps506 'ps506.dat';
options center linesize=76 nodate;
data;
infile ps506;
input @4 a b y;
if a=1 and b=1 then d11=1; else d11=0;
if a=1 and b=2 then d12=1; else d12=0;
if a=1 and b=3 then d13=1; else d13=0;
if a=2 and b=1 then d21=1; else d21=0;
if a=2 and b=2 then d22=1; else d22=0;
if a=2 and b=3 then d23=1; else d23=0;
if a=1 then ca1=1; else ca1=-1;
if b=1 then cb1=1;
if b=2 then cb1=-1;
if b=3 then cb1=0;
if b=1 or b=2 then cb2=1; else cb2=-2;
cab1 = ca1 * cb1;
cab2 = ca1 * cb2;
proc print;
proc reg;
  model y=d11 d12 d13 d21 d22/corrb;
  model y=ca1 cb1 cb2 cab1 cab2/corrb;
proc anova;
  class a b;
  model y=a b a*b;
run;
quit;