Creating bar charts with group classification is very easy using the SG procedures. When using a group variable, the group values for each category are stacked by default. Using the sashelp.prdsale data set and default STAT of SUM, here is the graph and the code. SGPLOT code: proc sgplot data=sashelp.prdsale;

## Tag: **GTL**

SAS 9.4 was released a month ago, and we are excited about all the new features in SG Procedures, GTL and Designer. I wrote an article on SAS 9.4 graph features last month, and promised more to come. What then could be better than this Tech Talk video hosted by our

Last week, I presented some highlights of the new features for SG Procedures and GTL in SAS 9.4. Now, let us dig in a bit deeper. For a plot without a GROUP role, setting an attributes was always easy with SG procedures. All you need to do to set bar color

The CLUSTER procedure in SAS/STAT software creates a dendrogram automatically. The black-and-white dendrogram is nice, but plain. A SAS customer wanted to know whether it is possible to add color to the dendrogram to emphasize certain clusters. For example, the plot at the left emphasizes a four-cluster scenario for clustering

Recently a user chimed in on the SAS Communities page, requesting a way to add some observation level annotation to a box plot. Wendy was delighted to see a graph created by the UNIVARIATE procedure called "Schematic Plot". In this graph, the box plot of the analysis variable is shown with

If you've watched any of the demos for SAS Visual Analytics (or even tried it yourself!), you have probably seen this nifty exploration of multiple measures. It's a way to look at how multiple measures are correlated with one another, using a diagonal heat map chart. The "stronger" the color

The PharmaSUG 2013 conference in Chicago this week was awesome. From the perspective of graphics, there was great interest in using SG Procedures, Designer and GTL for building clinical graphs. It was nice to see many papers by users on how they are using these tools for creating graphs on a daily

At a recent conference, I talked with a SAS customer who told me that he was using an R package to create a three-panel visualization of a distribution. Unfortunately, he couldn't remember the name of the package, and he has not returned my e-mails, so the purpose of today's article

I've previously described how to overlay two or more density curves on a single plot. I've also written about how to use PROC SGPLOT to overlay custom curves on a graph. This article describes how to overlay a density curve on a histogram. For common distributions, you can overlay a

The 2013 SAS Global Forum is around the corner in San Francisco and the anticipation is building. Early indications are that attendee registration is up from last year, and we are looking forward to a great conference starting Sunday, April 28. It is great to see the large and diverse offering

In the previous two articles we discussed Discrete Attribute Maps, and how these can be used to ensure that group attributes like color are consistently mapped to group values regardless of their position in the data. Now, let us take a look at the attributes map that allows you to

Last week I wrote about how you can use the Discrete Attributes Map to ensure that group values with specific names are represented in the graph with specific colors or other visual attributes such as marker symbol or line pattern. This attributes map also supports a special keyword "OTHER" which can be used to

You created a graph of Response over Time by Severity where Severity has three levels, "Severe", "Moderate' and "Mild". How do you ensure that "Severe" is always red in your graph, regardless of the data order? Normally, when creating any graph with a GROUP role, the distinct group values are assigned the style

A frequent question we get from users is how to create a box plot with custom whiskers lengths. Some want to plot the 10th and 90th percentile, while other want the 5th and 95th percentiles. The VBOX statement in the SGPLOT procedure does not provide for custom whiskers. Also, unlike GTL,

A common request we have been often hearing is for display of the distribution of data as a box plot, along with some detailed information overlaid. For example, one may have ratings data of all the hospitals in a region by different specialty, and you want to view this distribution

A parametric bar chart in SG Procedure and GTL parlance is a simplified version of the regular bar chart, where the data is assumed to be summarized prior to its usage inside the SG procedures or GTL. So, multiple occurrences of the same category and / or group combination is

Last week I was out to the 2nd Conference on Statistical Practice in New Orleans. It was a great opportunity to meet many users of SAS, R and other software and hear about their projects in applied statistics. I will write up my feedback on this conference soon. In the

The Graph Template Language (GTL) provides you the ability to create complex graphical layouts. We have seen how to create a regular grid of cells based on one or more classification variables using the SGPANEL procedure. Each cell contains the same type of plot. This topic was covered in Dan's article on

Often we have the need to see the data by two different classifiers at the same time, as requested by a recent query on the SAS Communities page. In this example I have simulated a response over time for patients by study and treatment. We want to create series plots

Just a few days ago our "super-duper tech support trooper" called in asking for the link to the subgrouped Forest Plot with bold headings. She was referring to this Forest Plot with Subgroups I had posted earlier. However, as you can see, while the subgroup values are indented from the subgroup headers, the headers

A recent question by a user lead led me to experiment with what is often referred to as conditional highlighting. The user wanted to display a bar chart of response by year, where each bar is colored by year, and show a cross hatch pattern on the bars where the

In the previous post on Violin Plots, we discussed the process to create custom density plots. This work was done in collaboration with SAS user James Marcus. This is the second installment on the same topic - Creating Density Strip Plots. We will use the same data and process to compute

The Scatter Plot Matrix statement supports a couple of different configurations. The basic is the N x N panel of cells, with each cell showing scatter plots plot for a pair of variables at a time. Here is an example of a 3 x 3 scatter plot matrix for the

A week ago, SAS "wusses" got together in Long Beach, California for another successful WUSS conference. Personally, I really enjoy all SAS user conferences as it gives me an opportunity to see the creative ways in which SAS users are exploiting our software. One such case was the paper "Power

Pie charts have been the subject of some criticism when they are used to compare measures across multiple categories. It is generally accepted that comparison of magnitudes represented as angular measures from varying baselines is not effective. However here are some use cases where a pie chart does quite well. When it comes

The Scatter Plot Matrix is a great tool that provides a quick visual of potential associations between variables. This may provide the analyst some hints on how to proceed with the analysis. Matrix of lab values for liver function tests are commonly used in clinical research. The SGSCATTER procedure provides an easy way

Forest plots come in many flavors. An example of a Forest plot using GTL is available on the SAS support web site. Simple forest plots can also be created using SGPLOT procedure by using the SCATTER statement with MARKERCHAR to display data aligned with the plot by study names. One issue

When you are working with probability distributions (normal, Poisson, exponential, and so forth), there are four essential functions that a statistical programmer needs. As I've written before, for common univariate distributions, SAS provides the following functions: the PDF function, which returns the probability density at a given point the CDF

I've been working on a new book about Simulating Data with SAS. In researching the chapter on simulation of multivariate data, I've noticed that the probability density function (PDF) of multivariate distributions is often specified in a matrix form. Consequently, the multivariate density can usually be computed by using the

Spark lines, made popular by Edward Tufte, provide a way to visualize trends in a concise space, often inline with the rest of the narrative or data. Previously, I posted an article on Spark Plots in which I created different plot types, some of which included multiple graphs and data in each row. For such