BookmarkSubscribeRSS Feed
emilys7
Calcite | Level 5

Bear with me as I am new to SAS and I'm assuming this is not a complicated question!

Using this code:

sgpanel data=histogram_data noautolegend;

     title "PW Distribution by Concentration and Acceptance";

     panelby accept concen / columns=2 rows=3 layout=lattice;


     histogram prowid;

    

     Label Prowid='Pronotum Width';

     Label concen='Concentration (%)';

     Label accept='Acceptance';


run;

I'm just trying to change the y axis from the default percent scale to frequency. When I try to use scale=count code it tells me it is out of order.

Any help out there?

Thanks!

1 REPLY 1
Jay54
Meteorite | Level 14

First, in general it is easier to help if you supply a full working program (with data) that can be run to produce a graph.  You can use one of the data sets in SASHELP to illustrate your issue.  It also helps to know the release of SAS you are using (9.2, 9.3, etc.).  I assume you left out the "proc" by error.

Having said that, with SAS 9.3 or higher release, you can use SCALE=count to get what you want.  I do not have access to SAS 9.2 right now, but if you do, you can try this code.

proc sgpanel data=sashelp.cars noautolegend;

     title "PW Distribution by Concentration and Acceptance";

     panelby origin drivetrain / columns=3 rows=3 layout=lattice;

     histogram mpg_city / scale=count;

run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 1343 views
  • 0 likes
  • 2 in conversation