BookmarkSubscribeRSS Feed
Yennie
Calcite | Level 5
Hey Experts,

I am sure you guys will know how to plot this graph..I have

VariableA
VariableB
VariableC

And I am wanting to plot VarA on X-axis and whereas this is the tricky bit...
Y-Axis will be VarB multiply by VarC.

Hope someone can help me out.

Cheers.
Yennie
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
You will need to create a new dataset -- either with a DATA step program or PROC SQL in which you create a new variable which is the result of the multiplication. Then you can plot the new variable and VariableA using either PROC GPLOT or PROC SGPLOT. There are lots of plotting examples in the documentation. For more information about how to create a new variable from an existing variables in an existing dataset, you should look at some of the examples in the documentation on Manipulating Data or using PROC SQL.

cynthia
GraphGuy
Meteorite | Level 14
Yennie - here's a short example ...

data tempdata; set sashelp.stocks;
VariableC=volume*close;
run;

proc gplot data=tempdata;
plot VariableC*date;
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 2 replies
  • 1153 views
  • 0 likes
  • 3 in conversation