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
SAS Super FREQ
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;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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