/* In this data set (taken from Spurrier */ /* (1993, Technometrics)), the response */ /* is the diameter of a cornmeal product */ /* and the predictor is the percent of */ /* sucrose in the product. */ DATA corn; INPUT sucrpct diameter; cards; 0 79 2 65 4 64 6 70 8 78 ; run; /* Checking the shape of the regression relationship */ symbol1 v=circle l=32 c = black; PROC GPLOT DATA=corn; PLOT diameter*sucrpct; RUN; /* A polynomial regression should be used here. */ /* Specifically, we will use a quadratic regression model. */ /* We will center the X variable: */ /* We also create a "quadratic-term" variable" */ PROC MEANS DATA = corn; VAR sucrpct; OUTPUT OUT = sucrstats MEAN(sucrpct) = meansucrpct; run; DATA corn2; IF _N_=1 THEN SET sucrstats; SET corn; csucrpct = sucrpct - meansucrpct; csucrpctsq = csucrpct**2; run; /* Looking at the new data set "corn2" */ PROC PRINT DATA = corn2; run; /* Now we perform the quadratic regression: */ PROC REG DATA = corn2; MODEL diameter = csucrpct csucrpctsq; RUN;