BookmarkSubscribeRSS Feed
MaryA_Marion
Lapis Lazuli | Level 10

Hello,

 

How to plot a scatter diagram and a regression plot of 3 variables taken 2 at a time putting the results in a 3 x 3 matrix?

 

Given the symbols xxx = blank cell, R= regression plot of 2 variables with data, S= scatterplot of 2 variables.

Now produce a matrix that will hold 9 graphs of which we will fill 6 cells. The cell contents

of the matrix will look as follows:

 

XXX   S         S

  R    XXX     S

  R      R     XXX

 

All of the plots have been created using proc SGplot using the reg and scatter subcommands.

I'm trying to keep this simple. Thank you in advance.

 

Sincerely,

Mary A. Marion
 

 

 

 

5 REPLIES 5
MaryA_Marion
Lapis Lazuli | Level 10

Reeza,

 

I need to include those scatterplots a well. I will try adding more statements.  Thanks.  MM

 

Reeza
Super User
What statements? Perhaps showing your code would help?
MaryA_Marion
Lapis Lazuli | Level 10

Hi,

 

I am learning about tidy data. It is a game-changer

Sep--May and year are columns in my data set.

I want a panel of 6 plots which is different from a matrix of 9 cells.

 

MM

 

SAS CODE:

proc sgpanel data=MYDATA;
panelby year Jan Feb Mar;
scatter y=Feb x=Jan;
scatter y=Mar x=Jan;
scatter y=Mar x=Feb;
reg x=year y=Jan;
reg x=year y=Feb;
reg x=year y=Mar;
reg x=Jan y=Feb;
reg x=Jan y=Mar;
reg x=Feb y=Mar;
run;

 

Rick_SAS
SAS Super FREQ

It sounds like you have already created the plots and just want to pack them together. Try the 

ODS LAYOUT GRIDDED.

...

ODS LAYOUT END;

 

Examples and discussion in 

Using the ODS statement to add layers in your ODS sandwich

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 684 views
  • 0 likes
  • 3 in conversation