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?
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.