BookmarkSubscribeRSS Feed
bhr-q
Quartz | Level 8

Hello, I can get the number based on the percentage displayed on the y-axis using the following code with (YSCALE=PERCENT).

How can I fix it to display the "%" symbol next to each number on the y-axis?

 

proc shewhart data=tmp2;
pchart yes_answer2*month /     subgroupn = n_per_group2 ODSTITLE="P-chart of Pts Counseling"
                                      outtable  = tmp2table  
                                      nohlabel nolegend  YSCALE=PERCENT ;    
LABEL yes_answer ="Prop of Pts counseled";
run;proc print noobs;run;

Thanks

 

4 REPLIES 4
Zard
SAS Employee

You could disable ODS Graphics and use an AXIS statement, such as

 

ods graphics off;
axis1 order=(0 to 50 by 10) value=('0%' '10%' '20%' '30%' '40%' '50%')
       label=("Pts Counseled") minor=none;
proc shewhart data=tmp2;
  pchart yes_answer2*month / subgroupn = n_per_group2 ODSTITLE="P-chart of Pts Counseling"
       outtable = tmp2table
       vaxis=axis1
       nohlabel nolegend YSCALE=PERCENT ;
run;
ods graphics on;

bhr-q
Quartz | Level 8

Thank you for your response, I don't have a SAS/Graph license as I get the below warning with your code:

 

WARNING: Traditional graphics are not available because either SAS/GRAPH is not licensed for your system, or the license has
expired.

 

Is there any other way I just want to put the '%'  beside the number in below plot:

 

bhrq_2-1721148961520.png

 

 

 

Thank you!

Quentin
Super User

I tried to get a % sign on the axis from a PROC SHEWHART p-chart and could not figure it out either.  If you find a way, please let us know.  : )

 

You can always output the data from PROC SHEWHART to a dataset, and use SGPLOT to make the plot.   But I decided it wasn't worth the trouble, and just lived without the percentage signs.  I put % in the title, and in the axis label, and decided that was enough.  But it's weird that it's not there in the axis values by default, since PROC SHEWHART has already been told that the yscale is a %.

The Boston Area SAS Users Group is hosting free webinars!
Next up: Bart Jablonski and I present 53 (+3) ways to do a table lookup on Wednesday Sep 18.
Register now at https://www.basug.org/events.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 522 views
  • 2 likes
  • 3 in conversation