Help using Base SAS procedures

Change class labels of comparative histogram in PROC UNIVARIATE

Accepted Solution Solved
Reply
Contributor
Posts: 28
Accepted Solution

Change class labels of comparative histogram in PROC UNIVARIATE

I am creating a comparative histogram (pic attached) in proc univariate and my class variable is entry (entry has two values, A and B).

The labels that are placed to the left of each histogram say "entry = A' and 'entry = B'.  How can I modify these so they only say 'A' and 'B' and leave off the 'entry = '.  I can't find anything online that says how to modify these.  The code that I am using is posted below:

 

proc univariate data=results noprint;

class entry;

var result;

histogram result / odstitle = 'Analyte' vscale=percent nocurvelegend normal(noprint);

run;


Histogram9.png

Accepted Solutions
Solution
‎09-29-2016 08:19 AM
Super User
Posts: 10,483

Re: Change class labels of comparative histogram in PROC UNIVARIATE

If you want more control over graph appearance than Proc Univariate provides then you might want to try using Proc Sgpanel

 

Which version of SAS are you using?

 

I don't get the variable name in the label as you do attempting your code structure with one of my datasets.

View solution in original post


All Replies
Solution
‎09-29-2016 08:19 AM
Super User
Posts: 10,483

Re: Change class labels of comparative histogram in PROC UNIVARIATE

If you want more control over graph appearance than Proc Univariate provides then you might want to try using Proc Sgpanel

 

Which version of SAS are you using?

 

I don't get the variable name in the label as you do attempting your code structure with one of my datasets.

Super User
Posts: 9,671

Re: Change class labels of comparative histogram in PROC UNIVARIATE


proc sgpanel data=sashelp.class;
 panelby sex/layout=rowlattice rowheaderpos=left novarname spacing=4;
 histogram weight;
 density weight;
run;

Contributor
Posts: 28

Re: Change class labels of comparative histogram in PROC UNIVARIATE

Thank you ballrdw and ksharp! I will use sgpanel instead of proc univariate to make these.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 281 views
  • 0 likes
  • 3 in conversation