options nocenter nodate; data one; input yield fert variety $; cards; 134 5 A 140 10 A 146 15 A 153 20 A 138 5 B 142 10 B 145 15 B 147 20 B ; data two; set one; y=yield; x1=fert; if variety='A' then x2=1; else x2=0; x3=x1*x2; run; proc print; run; proc reg; model y=x1 x2 x3; run; proc glm; model y=x1 x2 x3; estimate 'Variety A intercept' intercept 1 x2 1; estimate 'Variety A slope' x1 1 x3 1; estimate 'Variety B intercept' intercept 1; estimate 'Variety B slope' x1 1; run; data three; input yield fert variety $; cards; 134 5 A 140 10 A 146 15 A 153 20 A 138 5 B 142 10 B 145 15 B 147 20 B 137 5 C 144 10 C 150 15 C 158 20 C ; data four; set three; y=yield; x1=fert; if variety='A' then x2=1; else x2=0; if variety='B' then x3=1; else x3=0; x4=x1*x2; x5=x1*x3; run; proc print; run; proc reg; model y=x1 x2 x3 x4 x5; run; proc glm; model y=x1 x2 x3 x4 x5; estimate 'Variety A intercept' intercept 1 x2 1; estimate 'Variety A slope' x1 1 x4 1; estimate 'Variety B intercept' intercept 1 x3 1; estimate 'Variety B slope' x1 1 x5 1; estimate 'Variety C intercept' intercept 1; estimate 'Variety C slope' x1 1; run; proc glm; model y=x1 x2 x3 x5; estimate 'Variety A intercept' intercept 1 x2 1; estimate 'Variety A slope' x1 1; estimate 'Variety B intercept' intercept 1 x3 1; estimate 'Variety B slope' x1 1 x5 1; estimate 'Variety C intercept' intercept 1; estimate 'Variety C slope' x1 1; run;