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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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