Thursday, May 19, 2011

Modify the default ODS graphics behavior from statistical procedures

Those ODS graphics in the statistical procedures are predefined template using Graphics template language(GTL). Using ods trace on to find the name of that graph template. Then you have two ways to modify them.


1) output SAS codes of the survival graph template.

proc template;
source Stat.Lifetest.Graphics.ProductLimitSurvival;
run;

You can find and change them.

(a) "layout overlay / yaxisopts=(label="Survival Probability")".

(b) DiscreteLegend "Survival" / title=GROUPNAME across=1 location=inside autoalign=(TopRight BottomLeft Top Bottom);

(c) save as your template and next time you call it first. If not exist, then call the default template

2) when proc lifetest creates a plot, it also generates a data set for that graph. you can output data set and using SGplot procedure to redo it.Of course, you can use gplot. I prefer to use SGPLOT since it is new procedure with simple statements to create nice graphs.

you can search ods statistical graphics and GTL in SAS help.

No comments: