/* The dataset has the formats below permanently assigned to certain variables. We do NOT need to rerun the DATA step used to assign the formats however we DO need to resubmit the PROC FORMAT so SAS will know the translations used */ PROC FORMAT; VALUE GDR 1 = "Male" 2 = "Female"; VALUE YN 1 = "Yes" 2 = "No"; VALUE EXER 1 = "High" 2 = "Moderate" 3 = "Low"; VALUE TREAT 1 = "Ran" 2 = "Sat"; RUN; /* PROC SGPLOT */ /* SCATTER statement will produce a simple scatterplot */ PROC SGPLOT DATA=BIO.PULSE_STEP2; SCATTER Y = WEIGHT X = HEIGHT; RUN; /* LOESS statement will produce a scatterplot with an extra LOESS line This gives a smooth curve through the data. T he SMOOTH option must be greater than 0. The larger the value, the more smoothing. Usually you want to find a balance - you want to see any non-linear patterns but you don't want to want to try to fit the data exactly */ /* The values can be data dependent so some trial and error may be useful */ /* Too Little Smoothing */ PROC SGPLOT DATA=BIO.PULSE_STEP2; LOESS Y = WEIGHT X = HEIGHT / SMOOTH=0.1; RUN; /* Too Much Smoothing */ PROC SGPLOT DATA=BIO.PULSE_STEP2; LOESS Y = WEIGHT X = HEIGHT / SMOOTH=1.2; RUN; /* Reasonable Smoothing */ PROC SGPLOT DATA=BIO.PULSE_STEP2; LOESS Y = WEIGHT X = HEIGHT / SMOOTH=0.5; RUN; PROC SGPLOT DATA=BIO.PULSE_STEP2; LOESS Y = WEIGHT X = HEIGHT / SMOOTH=0.6; RUN; /* Default smoothing */ PROC SGPLOT DATA=BIO.PULSE_STEP2; LOESS Y = WEIGHT X = HEIGHT; RUN;