Desktop productivity for business analysts and programmers

How to make multiple plots (y*x1, y*x2, etc.) in SAS Enterprise Guide without repeating Tasks->Graph->Scatter Plot->Data for each graph?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 81
Accepted Solution

How to make multiple plots (y*x1, y*x2, etc.) in SAS Enterprise Guide without repeating Tasks->Graph->Scatter Plot->Data for each graph?

Is there a shortcut in SAS EG that allows me to make multiple plots: y*x1, y*x2, y*x3, .... simultaneously without repeating the Tasks->Graph->Scatter Plot->Data point and click routine for each plot?

I'd like to select a chunk of predictor variables and assign them to the horizontal axis, then select the response variable and assign it to the vertical axis, but alas there's a limit of one variable per axis.


Accepted Solutions
Solution
‎05-08-2015 06:11 PM
Super User
Posts: 11,105

Re: How to make multiple plots (y*x1, y*x2, etc.) in SAS Enterprise Guide without repeating Tasks->Graph->Scatter Plot->Data for each graph?

Proc Gplot can do this.

proc gplot data=plotdata;

     plot (y-variable list)*(x variable list);

or

     plot y*(x variable list);

run;

quit;

View solution in original post


All Replies
Super User
Posts: 19,038

Re: How to make multiple plots (y*x1, y*x2, etc.) in SAS Enterprise Guide without repeating Tasks->Graph->Scatter Plot->Data for each graph?

You could program it using proc sgplot?

proc sgplot data=have;

scatter x=x y=y1;

scatter x=x y=y2;

scatter x=x y=y3;

run;quit;

If you want multiple individual graphs look at SGSCATTER Procedures

Frequent Contributor
Posts: 81

Re: How to make multiple plots (y*x1, y*x2, etc.) in SAS Enterprise Guide without repeating Tasks->Graph->Scatter Plot->Data for each graph?

Right, I've used sgplot in the past but I have a lot of variables to plot & thought I'd leverage the work with some of the point & click tasks.

Solution
‎05-08-2015 06:11 PM
Super User
Posts: 11,105

Re: How to make multiple plots (y*x1, y*x2, etc.) in SAS Enterprise Guide without repeating Tasks->Graph->Scatter Plot->Data for each graph?

Proc Gplot can do this.

proc gplot data=plotdata;

     plot (y-variable list)*(x variable list);

or

     plot y*(x variable list);

run;

quit;

Frequent Contributor
Posts: 81

Re: How to make multiple plots (y*x1, y*x2, etc.) in SAS Enterprise Guide without repeating Tasks->Graph->Scatter Plot->Data for each graph?

Ballardw's proc gplot suggestion works fine - it looks like there aren't any options at the moment in SAS EG for a point and click version of this however.

Super User
Posts: 9,856

Re: How to make multiple plots (y*x1, y*x2, etc.) in SAS Enterprise Guide without repeating Tasks->Graph->Scatter Plot->Data for each graph?

How about BY statement ?

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 486 views
  • 1 like
  • 4 in conversation