FOCUS AREAS

Graphics

Fit Plot
Fit Plot
Base SAS: ODS Graphics Procedure: SGPLOT

/* Open the LISTING destination and assign the ANALYSIS style to the graph */ 
ods listing style=analysis;
ods graphics / width=5in height=2.81in;
title 'Mileage by Horsepower';

/* Run PROC SGPLOT on data SASHELP.CARS, using only US vehicles in the analysis */
proc sgplot data=sashelp.cars(where=(origin='USA')) noautolegend;
  /* Generate a regression plot with confidence limits for mean predicted values */
  reg x=horsepower y=mpg_city / degree=2 clm='CL Mean'; 

  /* position the legend inside the top-right corner of the plot area */
  keylegend / location=inside position=topright across=1;

  /* show grid lines on both axes */
  xaxis grid;
  yaxis grid;
run;