options pageno=1; data reg; input x rep y; xy=x*y; datalines; 10 1 432 20 1 334 30 1 224 40 1 199 50 1 134 60 1 125 10 2 410 20 2 403 30 2 300 40 2 280 50 2 247 60 2 225 ;; proc print; title 'Printout of Data - All Data'; run; proc reg; model y=x; title 'Regression on All Data - Reps Kept Separate'; run; proc sort; by x; proc means mean noprint; by x; var y; output out=new mean=meany; *Comment: The previous statement takes the average of Y1 and Y2 to create a new variable Y. Performing regression on means provides a better coefficient of determination'; run; proc reg; model meany=x; title 'Regression on the Mean of Y'; run;