BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
abarnett313
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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. ;

View solution in original post

4 REPLIES 4
ballardw
Super User

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. ;

abarnett313
Calcite | Level 5

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; 

abarnett313
Calcite | Level 5

Ah. Now I see what you mean. I added a format statement [ format LGBQ LGBQ.; ], and it produced the desired results. Thank you!

djrisks
Barite | Level 11

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2973 views
  • 0 likes
  • 3 in conversation