I have an interesting challenge with TEMPLATE. I am trying to create a lattice where each plot within the lattice is a panel of graphs. For a single panel of graphs, I can easily do this with SGPANEL, but I need to make a single figure with several different panels. The following TEMPLATE code works just fine to create a 1x4 panel of graphs (instead of using SGPANEL):
proc template;
define statgraph test12;
begingraph;
layout datapanel classvars=(type _trt) / rows=1 columns=4;
layout prototype;
bandplot x=year limitupper=uclmarg limitlower=lclmarg ;
seriesplot x=year y=y / lineattrs=graphFit ;
scatterplot x=year y=y / markerattrs=(size=8px color=blue symbol=circlefilled) ;
endlayout;
endlayout;
endgraph;
end;
run;
I would like to wrap the equivalent of a "LAYOUT LATTICE" around this to have several rows, where each row is a panel of four (or whatever) graphs (with a different response variable for each row). I realize that LAYOUT LATTICE does not allow for DATAPANEL, so I am looking for a workaround. For instance, I would like to use something like:
proc template;
define statgraph test12;
begingraph;
layout lattice / columns=1 rows=3;
layout datapanel classvars=(type _trt) / rows=1 columns=4;
layout prototype;
bandplot x=year limitupper=uclmarg limitlower=lclmarg ;
seriesplot x=year y=p / lineattrs=graphFit ;
scatterplot x=year y=y / markerattrs=(size=8px color=blue symbol=circlefilled) ;
endlayout;
layout datapanel classvars=(type _trt) / rows=1 columns=4;
layout prototype;
bandplot x=year limitupper=uclmarg2 limitlower=lclmarg2 ;
seriesplot x=year y=p2 / lineattrs=graphFit ;
scatterplot x=year y=y2 / markerattrs=(size=8px color=blue symbol=circlefilled) ;
endlayout;
endlayout;
....
endlayout;
endgraph;
end;
run;
Any recommendations on how to do this? Thanks.
LVM