Graphics Programming

Data visualization using SAS programming, including ODS Graphics and SAS/GRAPH. Charts, plots, maps, and more!
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 1144 views
  • 0 likes
  • 3 in conversation