![](https://blogs.sas.com/content/graphicallyspeaking/files/2017/05/WFKExpr2.png)
When the data object that underlies a graph is not quite in the form that you want, you might be able to use GTL expressions to produce precisely the graph that you want.
When the data object that underlies a graph is not quite in the form that you want, you might be able to use GTL expressions to produce precisely the graph that you want.
When presenting information in form of a graph we show the data and let the reader draw the inferences. However, often one may want to draw the attention of the reader towards some aspect of the graph or data. For one such case, a user asked how to highlight one
In last week's article about the Flint water crisis, I computed the 90th percentile of a small data set. Although I didn't mention it, the value that I reported is different from the the 90th percentile that is reported in Significance magazine. That is not unusual. The data only had
A SAS customer asked how to simulate data from a three-parameter lognormal distribution as specified in the PROC UNIVARIATE documentation. In particular, he wanted to incorporate a threshold parameter into the simulation. Simulating lognormal data is easy if you remember an important fact: if X is lognormally distributed, then Y=log(X)
Recently, while browsing health care data, I came across the graph shown below. The graph includes the healthy life expectancy at birth by countries in the EU, along with the associated per capita expenditure. The graph also shows estimate of potential gain in life expectancy by increasing expenditure efficiency. The
If a financial analyst says it is "likely" that a company will be profitable next year, what probability would you ascribe to that statement? If an intelligence report claims that there is "little chance" of a terrorist attack against an embassy, should the ambassador interpret this as a one-in-a-hundred chance,
A frequently asked question on SAS discussion forums concerns randomly assigning units (often patients in a study) to various experimental groups so that each group has approximately the same number of units. This basic problem is easily solved in SAS by using PROC SURVEYSELECT or a DATA step program. A
Most SAS regression procedures support a CLASS statement which internally generates dummy variables for categorical variables. I have previously described what dummy variables are and how are they used. I have also written about how to create design matrices that contain dummy variables in SAS, and in particular how to
There are several ways to visualize data in a two-way ANOVA model. Most visualizations show a statistical summary of the response variable for each category. However, for small data sets, it can be useful to overlay the raw data. This article shows a simple trick that you can use to
Fitting of long category values on a x-axis is usually a challenge. With SAS 9.4, the SGPLOT procedure tries to fit the values by first splitting the values at white space to see if the values will fit in the space available. This normally works well for a small number
When using the SAS® system to email graphics output, a common request is to use SAS to send an email in which the graphics output is embedded in the body of the email. This functionality is not available until the second maintenance release for SAS® 9.4 (TS1M2). If you are
Today, I focus on the steps needed to make a graph that is composed of multiple heterogeneous components (in this case, dendrograms and a heat map).
Restricted cubic splines are a powerful technique for modeling nonlinear relationships by using linear regression models. I have attended multiple SAS Global Forum presentations that show how to use restricted cubic splines in SAS regression procedures. However, the presenters have all used the %RCSPLINE macro (Frank Harrell, 1988) to generate
A reader commented on last week's article about constructing symmetric intervals. He wanted to know if I created it in SAS. Yes, the graph, which illustrates the so-called 68-95-99.7 rule for the normal distribution, was created by using several statements in the SGPLOT procedure in Base SAS The SERIES statement
Last week I published an article on creating bar charts with visual category values. The idea was to use visual icons for the category values in a HBAR of age by animal. For the data, I referred to a visual from the 2010 Encyclopedia Britannica Inc. that I found on the
A grouped box plot created by SGPLOT VBOX / HBOX statement or GTL BOXPLOT statement will display groups within categories using group colors and puts the color swatches representing the group values in the legend. This works well for a color graph created as shown below. title 'Distribution of Cholesterol
We often say a picture (or graph) is worth a thousand words. So, recursively, this could apply to other text in the graph. I thought it would be interesting to see if we can create a graph with visual categories. Another benefit is that such visual categories are inherently meaningful
In his recent blog article on Drawing Paths on a Map using SGPLOT, Robert Allison showed us visually the path computed by the captain of his return flight from Orlando. As usual, one can rely on Robert to put in visual form some interesting bit of information. Thanks, Robert. I
Most regression models try to model a response variable by using a smooth function of the explanatory variables. However, if the data are generated from some nonsmooth process, then it makes sense to use a regression function that is not smooth. A simple way to model a discontinuous process in
This post shows you how to make a bar chart and an X-axis table; ensure consistency in the order of the legend, bar subgroups, and axis table rows; coordinate the colors for each of those components; and drive all the color choices from an attribute map.
If you're into data visualization, here's something that might interest you - a free eBook showing several ways to use SAS to visually analyze your data. (Did I mention it's FREE?!?!) We've picked juicy chapters from several books and upcoming books (and a few other sources), to show you what
SAS Global Forum 2017 is around the corner and SAS users are gearing up to travel to Orlando for a blockbuster conference. ODS Graphics is now a well known component of Base SAS and many readers of this blog who are proficient users of SG Procedures and GTL can look
This article is motivated by a recent question on the Communities Web Site on creating a scatter plot with additional summary information. Recently, I described how to create a scatter plot with a box overlay. While such graphs have been discussed in earlier posts, this article provided a visual benefit
Funnel graphs are useful to track the number of visitors passing through various pages of a website or the number of patients in a study. The graph shows visually the retention of users or subjects in a study across levels of a marketing cycle or the study. One common representation
Monte Carlo techniques have many applications, but a primary application is to approximate the probability that some event occurs. The idea is to simulate data from the population and count the proportion of times that the event occurs in the simulated data. For continuous univariate distributions, the probability of an
Erwin Kalvelagen recently posted about a logic puzzle called Kakuro, also known as Cross Sums. As in traditional crossword puzzles, there are horizontal and vertical clues. As in Sudoku, each white cell is to be filled in with a digit from 1 to 9, with no digit repeated within the
A categorical response variable can take on k different values. If you have a random sample from a multinomial response, the sample proportions estimate the proportion of each category in the population. This article describes how to construct simultaneous confidence intervals for the proportions as described in the 1997 paper
Today's post illustrates the REG, PBSPLINE, LOESS, SERIES, and SPLINE statements in PROC SGPLOT. The GROUP= and BREAK options in the SERIES statement are also discussed.
Colors are the subject of many romantic poems and songs, but there isn't much romance to be found in their hexadecimal values. With apologies to Van Morrison: ...Skipping and a jumping In the misty morning fog with Our hearts a thumpin' and you My cx662F14 eyed girl When it comes
Back in 2013, I wrote a paper for the SAS Global Forum, reviewing the attributes that go towards making a good graph. In this paper, I covered many recommendations from industry thought leaders that can help enhance the effectiveness of graphs to deliver the intended information. One of the aspects that