SAS 9.4 releases today with a ton of new features. As eloquently stated by Craig Rubendall, the driving themes are "Enable. Simplify. Innovate". The same sentiment applies to the ODS Graphics, with a ton of new features for the SG Procedures, GTL and ODS Graphics Designer. In the next few articles,
Search Results: sgplot (964)
Four authors. Four papers. One set of data. The month of August and the 2014 Call for Content are just around the corner, and this seems like a good time to share a little inspiration and innovation. The Foundations and Fundamentals paper section at SAS Global Forum 2013 featured a four-part
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
A Bar Line graph is commonly used in many domains. The SGPLOT procedure makes it easy to create bar line graphs where the user can customize it in many different ways. This post is prompted by a recent question on the communities page on creating such a graph, with one bar and
If you write a blog, you deal with spam comments. That's just part of the deal. Spammers are forever inventing new and creative methods for "tricking" you into accepting their spam comments. These comments have nothing to do with your blog topic but do contain trackback links to their own
The SAS Global Forum conference last week was awesome. From the perspective of graphics, there were more papers from uses on graphics and ODS graphics then in recent times. I will post a summary shortly. One of the interesting papers was "#113-2013 - Creating Clark Error Grid using SAS/GRAPH and Annotate..."
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
I often see variations of the following question posted on statistical discussion forums: I want to bin the X variable into a small number of values. For each bin, I want to draw the quartiles of the Y variable for that bin. Then I want to connect the corresponding quartile
I was recently asked how to compute the difference between two density estimates in SAS. The person who asked the question sent me a link to a paper from The Review of Economics and Statistics that contains several examples of this technique (for example, see Figure 3 on p. 16
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
In a previous article, I described how to use Windows PowerShell to connect to a remote SAS Workspace, run a SAS program, and retrieve the results. In that example, the only results I retrieved were the SAS log and SAS listing (text) output, if any. When you run a SAS
It is easy to use the SGPLOT procedure in SAS to plot the graph of a well-behaved continuous function: just create a data set of the (x,y) values on some domain and use the SERIES statement to connect the points. However, to plot the graph of a discontinuous function correctly
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,
SG procedures and GTL use a collision avoidance algorithm to position data labels for a scatter or series plot. This is enabled by default. The label is preferably placed at the top right corner of the marker. The label is moved to one of the eight locations around the marker to
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
SAS Code for your Valentine - just in case you forgot to get flowers, chocolate or other tokens of affection for the big day yesterday.
John D. Cook shared a picture of "pretty squiggles" on his blog, as well as a prose description of the mathematics behind it. I'm more of a programmer than a mathematician, but I've attempted to transcribe his description into a SAS program. I used DATA step to generate the point
Netflix has made a big splash in the news with its use of big data. By analyzing millions of data points about the viewing habits of its customers, the movie delivery giant used the insight it gained to devise the "perfect show". One of the defining characteristics of the show,
Recently a reader chimed in with a question on the Do Loop article by Rick Wicklin on how to create a bar chart with percent statistics. Rick used SAS 9.3 and the reader wanted to do the same with SAS 9.2. For the basic (non-grouped) bar chart, the process is the
In my previous article on Adverse Event Timeline Graph, I wrote about how to create the AE timeline using SAS 9.2 code, using VECTOR plot and the MARKERCHAR option in SCATTER plot. I described a better way to place the labels at the lower end of the vectors. SAS 9.3 provides an easier way
Often it is desirable to use special Unicode characters for the tick value names on the axes. However, SG procedures and GTL do not support Unicode strings in SAS data sets. With SAS 9.3, the SGPLOT procedure supports annotation which does support Unicode strings. You can create an annotation data set
A commonly requested graph is a bar chart with response and targets. With SAS 9.3, the SGPLOT procedure supports new "parametric" plot statements called HBARPARM and VBARPARM. These statements are special versions of the HBAR and VBAR statements and they expect summarized data for each category or category+group combination. Also,
A while ago I saw a blog post on how to simulate Bernoulli outcomes when the probability of generating a 1 (success) varies from observation to observation. I've done this often in SAS, both in the DATA step and in the SAS/IML language. For example, when simulating data that satisfied
When a categorical variable has dozens or hundreds of categories, it is often impractical and undesirable to create a bar chart that shows the counts for all categories. Two alternatives are popular: Display only the Top 10 or Top 20 categories. As I showed last week, to do this in
Sometimes a categorical variable has many levels, but you are only interested in displaying the levels that occur most frequently. For example, if you are interested in the number of times that a song was purchased on iTunes during the past week, you probably don't want a bar chart with
In my previous post, I described how to implement an iterated function system (IFS) in the SAS/IML language to draw fractals. I used the famous Barnsley fern example to illustrate the technique. At the end of the article I issued a challenge: can you construct an IFS whose fractal attractor
Fractals. If you grew up in the 1980s or '90s and were interested in math and computers, chances are you played with computer generation of fractals. Who knows how many hours of computer time was spent computing Mandelbrot sets and Julia sets to ever-increasing resolutions? When I was a kid,
Naomi Robbins has posted a contest, part 1 of which is to submit alternative representations for the following graph: Clearly, usage of two pie charts to represent the share of the B2B and B2C referrals will invite many responses. To create the graph, I took the data shown in the Pie Charts themselves, so we are using percent