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

Hi Guys,

 

This histogram is not going my way. I'd like to achieve:

- present the all rows taller so Y-axis would show 0 through 100 by increasing the vertical dimension of the whole plot. 

- customize and label GROUPS so it will appear as "benign" instead group=6 and "malignant" instead group=5 so forth so on for all groups. 

 

You help will be greatly appreciated. 

Thanks in advance. 

 

proc univariate data=HAVE noprint;
   class GROUP;
   histogram VALUES/ nrows = 6
                     vaxis      =   0  to 100  by  1;
   inset median mean std / pos = ne format = 6.3;
run;

data Have;
do GROUP = 1 to 6;
   do j = 1 to 50;
      VALUES = rand("Normal", Group);
      output;
   end;
end;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Use the ODS GRAPHICS statement to set the vertical size of the plot.

Use PROC FORMAT to define the categories that you want to use for the GROUP=1 to 6 values:

 

data Have;
do GROUP = 1 to 6;
   do j = 1 to 50;
      VALUES = rand("Normal", Group);
      output;
   end;
end;
run;

proc format;
value TumorFmt  
      1 = "Benign"
      2 = "Cat 2"
      3 = "Next Value"
      4 = "Another"
      5 = "Almost There"
      6 = "Malignant";
run;

ods graphics / height=1000px width=400px;
proc univariate data=HAVE noprint;
   format GROUP TumorFmt.;
   class GROUP;
   histogram VALUES/ nrows = 6
                     vaxis      =   0  to 100  by  10;
   inset median mean std / pos = ne format = 6.3;
run;

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

Use the ODS GRAPHICS statement to set the vertical size of the plot.

Use PROC FORMAT to define the categories that you want to use for the GROUP=1 to 6 values:

 

data Have;
do GROUP = 1 to 6;
   do j = 1 to 50;
      VALUES = rand("Normal", Group);
      output;
   end;
end;
run;

proc format;
value TumorFmt  
      1 = "Benign"
      2 = "Cat 2"
      3 = "Next Value"
      4 = "Another"
      5 = "Almost There"
      6 = "Malignant";
run;

ods graphics / height=1000px width=400px;
proc univariate data=HAVE noprint;
   format GROUP TumorFmt.;
   class GROUP;
   histogram VALUES/ nrows = 6
                     vaxis      =   0  to 100  by  10;
   inset median mean std / pos = ne format = 6.3;
run;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 2071 views
  • 3 likes
  • 2 in conversation