Data visualization with SAS programming

Summary trellis plot/corr matrix code

Reply
New Contributor
Posts: 4

Summary trellis plot/corr matrix code

I am looking for some code to make my ideal summary display of data for reports.  On the diagonal and one triangle would be the output of: proc sgscatter; matrix var1--var5/ diagonal = (historgram normal); So, the scatter plots on the triangle, the histograms with a normal curve for the data users to compare the histograms to on the diagonal.  On the other triangle, would be the correlation matrix information: rho and p-values at least.  Bonus would be mean and sd on the diagonal and highlighting by significance on the correlations.  If found an example form NESUG 2007 (http://www.nesug.org/proceedings/nesug07/np/np18.pdf,  figure 4), that is close, but no code was included.  There has recently been a similar post, but not quite what I was looking for.  Can anyone point me in the correct direction?

SAS Employee
Posts: 980

Re: Summary trellis plot/corr matrix code

The graphs in that paper look pretty good! - I'd suggest contact the author and see if they can share the code with you, and that will make a good starting place.  Then, once you've got your data plotted with that code, you can post up some specific questions about possibly adding the extras you're wanting.

New Contributor
Posts: 4

Re: Summary trellis plot/corr matrix code

Unfortunately, I have tried that route.  The author is no longer at that company and has stopped contributing to NESUG. 

New Contributor
Posts: 4

Re: Summary trellis plot/corr matrix code

I am still wondering if you have any hints/ideas on how to re-create this trellis plot plus.   Trying to contact the author is fruitless

SAS Employee
Posts: 980

Re: Summary trellis plot/corr matrix code

Hopefully some of the ODS Graphics folks will chime in...

foo.png

SAS Super FREQ
Posts: 1,139

Re: Summary trellis plot/corr matrix code

The simple answer is "Yes, you can do this with GTL".  And here comes the "But"...

But, you have to do it using GTL LAYOUT LATTICE to define the grid as you want, and then populate each cell with the graph you need.  I posted an article in Graphically Speaking in August 20012 on creating a Compact Scatter Plot Matrix.  This will get you half the way there to build the lower triangle.  You can pick it up from there and add the other features.

New Contributor
Posts: 4

Re: Summary trellis plot/corr matrix code

Thank you Sanjay!  I have been playing around with GTL and learning a lot.  I also incorporated your histogram on the top row from another blog.  This left more room on the diagonal for more summary numbers.  I put them in there using the eval function.  Below, I have the simple version I have created so far with two variables.  I still have one cell empty where I want to put the correlations and the significance of the correlation.  That part is stumping me right now.  Could you point me in the right direction?

SGRender227.png

Ask a Question
Discussion stats
  • 6 replies
  • 736 views
  • 3 likes
  • 3 in conversation