Recently I posted an article on this blog on how to create bar charts with log response axes in response to a question by a user. This generated some feedback suggesting that bar charts should not be used with log response axes or with a baseline of anything other than
Search Results: sgplot (964)
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
Creating bar charts with log response axis has come up a few times in the past few days. Before we look into how we could do this, it would be worth pointing out the considerable opinion in the blogosphere against use of log response axes for bar charts. See BizIntelGuru and
On Friday before the conference, I presented a 1 day "developer led" seminar on SG Procedures and GTL, along with a discussion of new features for SAS 9.3. The experience was very gratifying as all users were now using SAS 9.2, and some were using SAS 9.3. We had a lively
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
Last week I discussed how to fit a Poisson distribution to data. The technique, which involves using the GENMOD procedure, produces a table of some goodness-of-fit statistics, but I find it useful to also produce a graph that indicates the goodness of fit. For continuous distributions, the quantile-quantile (Q-Q) plot
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
The birthday matching problem is a classic problem in probability theory. The part of it that people tend to remember is that in a room of 23 people, there is greater than 50% chance that two people in the room share a birthday. But the birthday matching problem is also
In yesterday's post, I discussed a "quick and dirty" method to smooth periodic data. However, after I smoothed the data I remarked that the smoother itself was not exactly periodic. At the end points of the periodic interval, the smoother did not have equal slopes and the method does not
Over at the SAS and R blog, Ken Kleinman discussed using polar coordinates to plot time series data for multiple years. The time series plot was reproduced in SAS by my colleague Robert Allison. The idea of plotting periodic data on a circle is not new. In fact it goes
Over at the SAS Discussion Forums, someone asked how to use SAS to fit a Poisson distribution to data. The questioner asked how to fit the distribution but also how to overlay the fitted density on the data and to create a quantile-quantile (Q-Q) plot. The questioner mentioned that the
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,
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
How to write a SAS macro program to repeat your SAS processing for each value of a BY grouping variable.
When the data is classified by multiple class variables, you can certainly create graphs using BY variables. This results in separate graphs, one for each level of the BY variable crossings. Each graph is scaled by its own data subset, and comparisons across BY levels is harder. When comparisons need to be
Most statistical programmers have seen a graph of a normal distribution that approximates a binomial distribution. The figure is often accompanied by a statement that gives guidelines for when the approximation is valid. For example, if the binomial distribution describes an experiment with n trials and the probability of success
During IFSUG yesterday, Sunil Gupta gave attendees to his presentation a special homework assignment. Look into the SAS Enterprise Guide task 'Characterize Data'. Sunil suggested that this was a simple approach to quickly getting a summary of all the variables within your data table. Of course, some programmers will use
I work with continuous distributions more often than with discrete distributions. Consequently, I am used to thinking of the quantile function as being an inverse cumulative distribution function (CDF). (These functions are described in my article, "Four essential functions for statistical programmers.") For discrete distributions, they are not. To quote
I've blogged several times about multivariate normality, including how to generate random values from a multivariate normal distribution. But given a set of multivariate data, how can you determine if it is likely to have come from a multivariate normal distribution? The answer, of course, is to run a goodness-of-fit
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.
The graph showing the distribution of the maximum liver function test values by treatment for all participants in a study is commonly used for the analysis of safety data in clinical trials. The data is often structured in multiple columns (one per treatment) as below on the left, or grouped by
Here is the second installment of sample graphs from the SG Procedures book - The Adverse Event Timeline. This is a graph commonly used in patient profiles for clinical trials where we track the progress of a patient through a hospitalization event, tracking the dates and severity of the adverse events. The
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:
In December of last year, the book "Statistical Graphics Procedures by Example" co-authored by Dan Heath and I was published. On the back cover, it proclaims "Free Code on the Web". Now, who can resist such an offer? Since most of the examples in the book have very short syntax,
Recently, I had a discussion with a user concerning the volume of imagemap data generated for an interactive, web-based visual contain a large number of graphs. The large amount of imagemap data was causing problems with the current version of their web browser. The graphs consisted of either bar charts
So many of us struggle with this mountain. In fact, 68.27% of us get within sight of reaching the summit (while 95.47% of us are at least on a perceivable slope). We run, walk, crawl and sometimes slide our way uphill (from one direction or the other) until we finally
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
I was on vacation when a family member sidled up to me. "Rick, you're a statistician..." he began. I knew I was in trouble. He proceeded to tell me the story of Joseph "Newsboy" Moriarty, a New Jersey mobster who rose to prominence and became known as the bookie who
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
An issue that SAS/GRAPH users have wrestled with in the past has been how to put tick marks at irregular intervals on their axes. In PROC GPLOT, if you specify irregular intervals using the ORDER option on the AXIS statement, the procedure’s axis kicks into a “discrete” mode, where the