I see this following bar chart that made by SAS viya I guss. Wonder if this can be done in PC SAS? Thanks!
@PaigeMiller is correct. To create multiple bar charts with different response variables in one graph, you would need to use either the Graph Template Language (GTL), or use ODS LAYOUT with the SG procedures (SGPLOT in this case). If you were using the same response variable with multiple classifiers, your best option is to use the SGPANEL procedure.
ODS LAYOUT is normally applied at the page level. However, there is a trick for generating the output via ODS PRINTER such all of the output is generated in one image. I talk about this technique more in-depth in this blog post . The example below demonstrates this technique using bar charts.
ods _all_ close; options nodate nonumber; options leftmargin="0.001in" rightmargin="0.001in"; options papersize=(7.35in 2.00in); title "Car Statistics"; ods printer printer=png300 file="cars.png" style=htmlblue; ods layout gridded columns=3 advance=proc column_gutter=0.1in row_gutter=0.1in; ods graphics / width=2.25in noborder; title; proc sgplot data=sashelp.cars noopaque; yaxis grid; vbar origin / response=horsepower fillattrs=GraphData1 transparency=0.5; run; proc sgplot data=sashelp.cars noopaque; yaxis grid; vbar origin / response=mpg_city fillattrs=GraphData2 transparency=0.5; run; proc sgplot data=sashelp.cars noopaque; yaxis grid; vbar origin / response=mpg_highway fillattrs=GraphData3 transparency=0.5; run; ods layout end; ods printer close;
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.