An example of polynomial regression using proc reg in SAS.
There are three variables in the grandfather clock data: age of the clock (age),
the number of bidders in the auction (bidders), and the clock's selling price (price).
In the SAS data set we also create second order terms for age (age2) and bidders
(bidders2) and the product of age and bidders (agebid).
SAS code for various interaction models is given below.
data gfclock;
input age bidders price;
age2 = age*age;
bidders2 = bidders*bidders;
agebid = age*bidders;
datalines;
127 13 1235
115 12 1080
127 7 845
150 9 1522
156 6 1047
182 11 1979
156 12 1822
132 10 1253
137 9 1297
113 9 946
137 15 1713
117 11 1024
137 8 1147
153 6 1092
117 13 1152
126 10 1336
170 14 2131
182 8 1550
162 11 1884
184 10 2041
143 6 845
159 9 1483
108 14 1055
175 8 1545
108 6 729
179 9 1792
111 15 1175
187 8 1593
111 7 785
115 7 744
194 5 1356
168 7 1262
;;;
proc reg data = gfclock;
title "Main effects model";
model price = age bidders;
run;
proc reg data = gfclock;
title "Interaction model";
model price = age bidders agebid;
run;
proc reg data = gfclock;
title "Interaction and quadratic model";
model price = age age2 bidders bidders2 agebid;
quadratic: test age2, bidders2;
run;