BookmarkSubscribeRSS Feed
nancya
Calcite | Level 5

Hi

I am new to using SAS and have been trying to figure out how to diplay both frequency and average in the same graph plot.

here is a sample data and what I like the graph to display

 

policy No    Group 1              Retention Rate

 

1                 SUV                               2%

2                 Truck                             4%

3                 Truck                             4%

4                  SUV                              2%

5                  Hatch Back                   3%

 

Now I want a bar graph to display the no of polices in group 1 - graph will show SUV Truck Hatch Back and the frequency of polices.

And I want a line graph to show the the average retention rates in group 1. And I want both the bar and line graph in the same graph (with different axis ,ofcourse)

 

PS I use SAS Sybase, if that makes a difference,

4 REPLIES 4
Reeza
Super User
Create a data set with the summarized data, then it's easy to create this using SGPLOT.
It's one of the documentation examples: https://documentation.sas.com/?docsetId=grstatproc&docsetTarget=n1mp0swy0atvzun1oeqlkrg8d89o.htm&doc...
nancya
Calcite | Level 5

Thanks for the quick reply. can i use sg plot if I don't have ODS installed?

Reeza
Super User

ODS is part of Base SAS. What makes you think you don't have that installed?

 


@nancya wrote:

Thanks for the quick reply. can i use sg plot if I don't have ODS installed?


 

PeterClemmensen
Tourmaline | Level 20

Calculate the desired statistics and use VBARPARM and SERIES Statements in PROC SGPLOT. The VBAR and SERIES statements are not allowed to overlay.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 988 views
  • 0 likes
  • 3 in conversation