Greetings,
I am using Proc SGPanel to create two histograms for different levels of the same variable (named "LGBQ"). LGBQ is coded to have values of either 1 or 2; I have used Proc Format to indicate that 1 = Heterosexual and 2 = LGBQ. When I use Proc SGPanel, the two panels are labeled "LGBQ=1" and "LGBQ=2". Is there a way to have Proc SGPanel pull the formatted labels instead of the values for the variables? Or to alter the headings for each column? I'm using SAS Enterprise Guide 4.3. Any help or insight would be greatly appreciated.
I'm a relative SAS newbie and couldn't find any articles or posts that addressed this issue; apologies if there is one already that I missed.
Thanks,
Andrew
Showing the code you used would help.
Did you actually use assign the format to the variable in either the data set or the SGPANEL? it would look like this:
Format LBGQ formatname. ;
Showing the code you used would help.
Did you actually use assign the format to the variable in either the data set or the SGPANEL? it would look like this:
Format LBGQ formatname. ;
I used this code for proc sgpanel:
proc sgpanel data=D1; panelby LGBQ / uniscale=all; histogram VictimLGBT; density VictimLGBT; run;
And I formatted the dataset using this statement (earlier in the program than proc sgpanel:
proc format; value LGBQ 1 = "Heterosexual" 2 = "LGBQ"; run;
Ah. Now I see what you mean. I added a format statement [ format LGBQ LGBQ.; ], and it produced the desired results. Thank you!
Greetings, I thought the formatted value will be shown automatically as long as you are also using the format statement? Have you used the format statement within your proc sgpanel?
Thanks
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.