Tips and Tricks

Tips and Tricks

Data Visualization
Sanjay Matange 0
Axis values and hint

Getting the axis values just right generally requires some work, and the values you want can change from case to case.  One such example was discussed by Dan Heath in his post on custom axis values.  Here Dan shows the usage of non uniform axis values using the VALUES option on

Data Visualization
Sanjay Matange 0
Just a legend, please

Recently, an interesting question was posed on the previous article on this blog by a reader.  Can we use the new DiscreteAttrMap feature to create just a legend with specific entries, with no graph.  The question was intriguing enough that I did not wait to ask - "Why?".  I just got

Data Visualization
Sanjay Matange 0
Bar chart on interval axis

Recently, a user asked about creating a Bar Chart of Value by Date, where the dates are displayed on a scaled interval axis.   Consider this simulated data set of value by date and treatment shown below.  This data set only has one value for each date and treatment combination. We can use the VBAR statement

Data Visualization
Sanjay Matange 0
Simpler is better

A recent article in the SAS and R blog was about current winter temperatures in Albany, NY.  The temperature data for the recent winter (Dec 2011 - Mar 2012) was plotted on a polar graph. Robert Allison posted an article on displaying the same data as a Polar Graph using SAS/GRAPH .  Here is his

Data Visualization
Sanjay Matange 0
Bar-Line graph

A user recently posted a question in the SAS communities forum about  how to best display two measures by one classifier using a Bar-Line graph, where the scale of the two measures is vastly different.  This got me thinking about various different ways to represent such data.  Here are some of my thoughts,

Data Visualization
Sanjay Matange 0
Cluster groups

The topic of cluster groups comes up often.  By cluster group I am referring to the feature in bar charts where the group values are displayed side by side. With SAS 9.3, SG Procedures support stack or cluster grouping for Bar Charts and overlay or cluster grouping for all other

Data Visualization
Sanjay Matange 0
Let them eat pie

ODS Graphics system was initially motivated by the need for high quality graphs for SAS Base, STAT, and other analytical procedures.  Use of SG Procedures, ODS Graphics Designer and GTL by users too has initially focused on analytical graphs.  But just like wheels on carryon bags that started for the specific needs of flight

Data Visualization
Sanjay Matange 0
High resolution graphs

Creating a graph that looks nice, with readable, high resolution fonts is important and should be easy to do.  With SG procedures and GTL, this is easy to do with a simple option, but not the default. Creating a high resolution (image) for a graph consumes higher system resources.  When working on a graph,

Data Visualization
Dan Heath 0
Roses are red, violets are blue...

This classic start to a romantic poem assumes that the correct colors are always assigned to the correct flowers; but, for those who create graphs for reports, consistent color assignment can be more of a challenge than an assumption. This challenge is particularly true for the display of group values.

Data Visualization
Sanjay Matange 0
Dashboard graphs revisited

Here is the promised follow up on the Dashboard graph.  In the previous article, I posted the code to create a panel of bullet KPIs displaying three different metrics.  For each KPI, I used 5 columns of data which resulted in a wide and inconvenient structure. A more convenient data structure is

Data Visualization
Sanjay Matange 0
Dashboard graphs

In this blog we have been discussing graphs useful for analysis of data for many domains such as clinical research, forecasting and more.  SG Procedures and GTL are particularly suited for these use cases.  So, when I came upon a dashboard image from Steven Few's Visual Business Intelligence blog, showing the

Data Visualization
Sanjay Matange 0
Beer, diapers and heat map

The parable of beer and diapers is often related when teaching data mining techniques.  Whether fact or fiction, a Heat Map is useful to view the claimed associations.  A co-worker recently enquired about possible ways to display associations or dependency between variables.  One option is to show the dependency as a node

Data Visualization
Sanjay Matange 0
Comparative density plots

Recently a user posted a question on the SAS/GRAPH and ODS Graphics Communities page on how to plot the normal density curves for two classification levels in the same graph. We have often seen examples of a  distribution plot of one variable using a histogram with normal and kernel density curves.  Here is a simple example: Code Snippet:

Data Visualization
Sanjay Matange 0
Nested graphs

Here are a couple of bar charts showing the city mileage of cars by Type and Origin using the SGPLOT procedure from the sashelp.cars dataset. title 'Vehicle Mileage by Type'; proc sgplot data=cars; format mpg_city 4.1; vbar type / response=mpg_city stat=mean datalabel; xaxis display=(nolabel); run; title 'Counts by Country'; proc sgplot

Data Visualization
Sanjay Matange 0
Timeseries plots with regimes

Recently we discussed the features of the Shiller Graph, showing long term housing values in the USA.  To understand the features necesary in the SGPLOT procedure to create such graph easily, it was useful to see how far we can go using GTL as released with SAS 9.2(M3). I got the data Shiller Housing index data

Data Visualization
Sanjay Matange 0
The more the merrier

Often it is useful to view multiple responses by a common independent variable all in the same plot.  SGPLOT procedure and GTL support the ability to view two responses, one each on the Y and Y2 axes by one independent variable (X) in one graph.  Yes, you can also have X

Data Visualization
Sanjay Matange 0
Custom confidence intervals

Recently a user posted a question on the SAS/GRAPH and ODS Graphics Forum about drawing a plot with custom confidence intervals .  The user has a simple data set with category, response (mean) and custom lower and upper confidence intervals.  The data looks like this: Robert Allison provided the code (proc gplot +

1 9 10 11 12

Back to Top