Hello everyone,
I am trying to analyze the BRFSS 2013 data and want to create a plot like
Can someone guide me on how to create a graph like this in SAS.? I tried using the code mentioned below -
ods graphics / reset width=6.4in height=4.8in imagemap;
proc sgplot data=WORK.BRFSS_13N;
vbar SEX_N / group=educatg group= _RFSMOKN groupdisplay=cluster datalabel;
yaxis grid;
run;
ods graphics / reset;
It created a graph with Education level at X-axis and grouped the data by SEX but I need to add another variable Smoking into the picture.
Kindly guide me. Thank you for your time and help
SGPANEL example:
proc sgpanel data=sashelp.prdsale;
panelby year / columns=2;
vbar product / response=actual
GROUP=region GROUPDISPLAY=CLUSTER
;
run;
title;
Gives:
Bart
did you try with SGPANEL? (https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/p17wwoehcyc6mxn1hpcgxy8ixw6w.htm)
Bart
SGPANEL example:
proc sgpanel data=sashelp.prdsale;
panelby year / columns=2;
vbar product / response=actual
GROUP=region GROUPDISPLAY=CLUSTER
;
run;
title;
Gives:
Bart
Just to be persnickety, did you use one of the survey procs to use the sample design and weighting data in the BRSS data to get the weighted population counts, or possibly another tool like SUDAAN to deal with the complex sample design?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.