Can I run a dynamic proc template of histogram but with different groups? I have a variable, it has three groups, I can run with different groups in boxplot, but how can I edit histogram part by groups? Below is the code I use and the output.
define statgraph mygraphs.dynamics;
layout lattice / columns = 1 rows = 2
columndatarange = union
rowgutter = 2px;
mvar SYSDATE9 SCALE;
dynamic VAR VARLABEL;
entrytitle 'Histogram of ' VAR;
entrytitle 'with Normal Distribution';
columnaxis / label = 'var';
layout overlay / xaxisopts=(label=VARLABEL)
yaxisopts = (offsetmin = .03);
histogram VAR / display = standard;
densityplot VAR / normal( );
boxplot y = var x = group/ orient = horizontal;
entryfootnote halign=right "Created: " SYSDATE9 / textattrs=GraphValueText;
proc sgrender data=combine_1 template='mygraphs.dynamics';
dynamic var='P_SCALE_SCORE_PHYSICAL_FUNCTI' varlabel='P_SCALE_SCORE_PHYSICAL_FUNCTI';
@echoli, in the end, did you find a solution? I know it has been a while since the last post but I am facing the exact same problem and don't know how to do so if you have a hint, I would be very interested 🙂
P.S.: Please be kind, I am a SAS newbie 🐥
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.