Search notes:

SAS: proc template

Overlay

The following example demonstrates how to overlay two plots (a loess fit and a regression fit:
ods graphics on;

data eggs_why;
  do i = 1 to 1000;
     eggs = i + rand('norm') * 3;
     why  = i/100 + 4 + sin(eggs/50) + rand('norm') * 2;
     output;
  end;
run;

proc template;
  define statgraph tq84_overlay;
  begingraph;
  layout overlay;
    scatterplot    x=eggs y=why;
    loessplot      x=eggs y=why / lineattrs = (color=blue);
 /* pbsplineplot   x=eggs y=why / lineattrs = (color=red ); */
    regressionplot x=eggs y=why / lineattrs = (color=red ) degree=6; 
  endlayout;
  endgraph;
  end;
run;

proc sgrender
      data     = eggs_why
      template = tq84_overlay;
run;
Github repository about-SAS, path: /programming/proc/template/overlay.sas

source

Create a rather noisy output:
proc template;
     source;
run;
Github repository about-SAS, path: /programming/proc/template/source.sas

See also

proc report
SAS programming: proc

Index