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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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