BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASdevAnneMarie
Rhodochrosite | Level 12

Hello Experts,

 

I would like to see the bivariate analysis with proc sgscatter but I have 22 variables. The output graph is too small to read.

Do you know, please how to improve this?

 

Thank you for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

If the problem is that the large number of variables causes the individual plots to be too small, one option is to increase the size of the graph. With a larger graph, you might not be able to see all of it within page boundaries, but you can pan around within it to look at the individual plots which should now be large enough to be useful. For example, if you use the typical HTML destination for your output, the following uses the HEIGHT= and WIDTH= options in the ODS GRAPHICS statement to create a larger graph size. In the HTML output window, you can scroll right, left, up, and down to view the individual plots as needed.

ods graphics / height=60in width=60in;
proc sgscatter data=sashelp.junkmail;
matrix
            Address     Addresses    All       Bracket    Business
            CS          CapAvg       CapLong   CapTotal   Conference
            Credit      Data         Direct    Dollar     Edu
            Email       Exclamation  Font      Free       George
            HP          HPL          
;
run;

View solution in original post

6 REPLIES 6
PaigeMiller
Diamond | Level 26

I can think of several ways

 

1. Principal Components Analysis, plot of the scores in the first k dimensions

2. Selecting just a few "important" variables and scatterplotting those

3. Split the 22x22 grid into many smaller grids

 

As always, people need to tell us WHY you are doing this, and people need to tell us WHAT you would like to learn from this exercise. This would lead to much more targeted and useful replies. Don't just tell us the programming step(s) you are having trouble with.

--
Paige Miller
StatDave
SAS Super FREQ

If the problem is that the large number of variables causes the individual plots to be too small, one option is to increase the size of the graph. With a larger graph, you might not be able to see all of it within page boundaries, but you can pan around within it to look at the individual plots which should now be large enough to be useful. For example, if you use the typical HTML destination for your output, the following uses the HEIGHT= and WIDTH= options in the ODS GRAPHICS statement to create a larger graph size. In the HTML output window, you can scroll right, left, up, and down to view the individual plots as needed.

ods graphics / height=60in width=60in;
proc sgscatter data=sashelp.junkmail;
matrix
            Address     Addresses    All       Bracket    Business
            CS          CapAvg       CapLong   CapTotal   Conference
            Credit      Data         Direct    Dollar     Edu
            Email       Exclamation  Font      Free       George
            HP          HPL          
;
run;
SASdevAnneMarie
Rhodochrosite | Level 12
Thank you, StatDave!
StatDave
SAS Super FREQ

Or, you could not change HEIGHT= and WIDTH= and instead create a series of graphs showing 5x5 subsets of the plots in the full scatterplot. For example,

/* first vertical strip of 5 plots in full 22x22 scatterplot */
proc sgscatter data=sashelp.junkmail;
compare 
  y=(Address     Addresses    All       Bracket    Business)
  x=(Address     Addresses    All       Bracket    Business);
run;
proc sgscatter data=sashelp.junkmail;
compare 
  y=(CS          CapAvg       CapLong   CapTotal   Conference)
  x=(Address     Addresses    All       Bracket    Business);
run;
/* ... other variable sets in 1st strip of 5 plots ... */
proc sgscatter data=sashelp.junkmail;
compare 
  y=(            HP          HPL)
  x=(Address     Addresses    All       Bracket    Business);
run;

/* second vertical strip of full scatterplot */
proc sgscatter data=sashelp.junkmail;
compare 
  y=(CS          CapAvg       CapLong   CapTotal   Conference)
  x=(CS          CapAvg       CapLong   CapTotal   Conference);
run;
/* ... other variable sets in 2nd strip ... */
proc sgscatter data=sashelp.junkmail;
compare 
  y=(            HP          HPL)
  x=(CS          CapAvg       CapLong   CapTotal   Conference);
run;

/*... 3rd, 4th, and 5th strips ending with ... */
proc sgscatter data=sashelp.junkmail;
compare 
  y=(            HP          HPL)
  x=(            HP          HPL);
run;
Ksharp
Super User

As @StatDave showed you , you could use " height=60in width=60in;" to control the size of graph .

Or creating a triangle correlation matrix like :

 

https://blogs.sas.com/content/graphicallyspeaking/2017/12/11/displaying-upper-lower-triangle-correla...

 

 

StatDave
SAS Super FREQ

My second post shows how to produce the 5x5 subset plots in the lower triangle of the scatterplot matrix.

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
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
  • 6 replies
  • 453 views
  • 3 likes
  • 4 in conversation