options ls=80 nodate;

data coal;
input y x polymer;
z1=(polymer=
'1'); z2=(polymer='2'); z3=(polymer='3');
xz1 = x*z1;
/* interaction term */
xz2 = x*z2; /* interaction term */
cards;
292 6.5 1
329 6.9 1
352 7.8 1
378 8.4 1
392 8.8 1
410 9.2 2
198 6.7 2
227 6.9 2
277 7.5 2
297 7.9 2
167 6.5 3
225 7.0 3
247 7.2 3
268 7.6 3
288 8.7 3
;

proc print;
title 'polymer data set';
run;

/* Example 8.3: fitting the parallel-lines model */

proc glm;
model y = x z1 z2;
title 'parallel lines model';
run;

/* Example 8.3: fitting the single regression line model */

proc glm;
model y = x;
title 'single regression line model';
run;

/* Example 8.4: fitting the interaction model */

proc glm;
model y = x z1 z2 xz1 xz2;
title 'interaction model';
run;

/* Example 8.4: fitting the common-intercept model */

proc glm;
model y = x xz1 xz2;
title 'common-intercept model';
run;