Dear All,
I just defined one template aims to create one histogram change with group.
I wanted to add another seriesplot to connect the different bars over time for each group. However, when I tried added the SERIESPLOT in the layout prototype, and then run, there was always a WARNING:
WARNING: The scatterplot statement will not be drawn because one or more of the required arguments were not supplied.
So could you guide me why this happen? And how should I do to reach my aim.
Many thanks,
Jack
*******Pot the frequency data by country, visit and the category;
PROC TEMPLATE;
define statgraph freq_hist;
begingraph/designwidth=20in designheight=10in;
dynamic _x _y _title _footnote _rowvar _columnvar _group;
entrytitle _title;
entryfootnote _footnote;
layout datalattice ROWVAR=_rowvar columnvar=_columnvar/rows=2 backgroundcolor=aliceblue border=FALSE headerbackgroundcolor=lightblue
columnaxisopts=(display=(ticks tickvalues label) griddisplay=ON label="Visit (month)")
rowaxisopts=(display=(ticks tickvalues label) griddisplay=ON label="Frquency")
skipemptycells=TRUE
cellwidthmin=80;
layout prototype;
barchart category=_x Response=_y/group=_group groupdisplay=CLUSTER includemissinggroup=TRUE
barlabel=TRUE barlabelfitpolicy=NONE barlabelattrs=(color=gray) name="barchart" legendlabel="BCVA Score";
seriesplot x=_x y=_y/group=_group groupdisplay=CLUSTER ;
**scatterplot x=_x y=_y/group=_group groupdisplay=CLUSTER jitter=AUTO;
endlayout;
sidebar;
discretelegend "barchart"/backgroundcolor=lightcyan border=TRUE location=INSIDE title="BCVA SCORE";
endsidebar;
endlayout;
endgraph;
end;
run;
proc sgrender data=VA_country(where=(missing(BCVASCOR1N)=0)) template=freq_hist;
dynamic _x="VIS2N" _y="COUNT" _label="Frequency plot of the different scores over Visit" _footnote="Test with categorical data illustration.sas"
_rowvar="COU1A" _columnvar="EVLEYE1C" _group="BCVASCOR1N"
;
format vis2n VIS_month. COU1A $country.;
run;
It is easier to help if you attach full code WITH associated data and any macro variables. The data can be faked to preserve confidentiality, as long as the program runs. Clearly, as per log, some data is not as expected. Also please always include the SAS version you are using.
Any reason you are not using SGPANEL?
Use " sidebar / spacefill=false; " to shrink legend width.
Dear Sanjay,
Sure, thanks for your suggestion. The version I am using is SAS 9.4 server version.
I will take a try on your proposal. Many thanks.
Jack.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.