Created
December 6, 2014 03:50
-
-
Save statgeek/4f507ee768f51a355141 to your computer and use it in GitHub Desktop.
SAS - Add by value title to GTL Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*valid in SAS 9.3+, using the dynamic variable _byval_ that is automatically created by SAS; | |
proc template; | |
define statgraph scatter; | |
dynamic _x _y _byval_; | |
begingraph; | |
entrytitle "Scatter Plot of " _x " by " _y " for Sex = " _byval_; | |
layout overlay; | |
scatterplot x=_x y=_y; | |
endlayout; | |
endgraph; | |
end; | |
run; | |
proc sort data=sashelp.class out=class; | |
by sex; | |
run; | |
proc sgrender data=class template=scatter; | |
by sex; | |
dynamic _x='height' _y='weight'; | |
run; | |
/*Reference: | |
http://support.sas.com/documentation/cdl/en/grstatug/63302/HTML/default/viewer.htm#n0c1svsedk2ptcn1gv0o80xfhyi6.htm | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment