Posts Tagged ‘ Statistical Graphics ’

How to plot a discontinuous function

March 25, 2013
By

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
Read more »

Tags: ,
Posted in SAS | Comments Off on How to plot a discontinuous function

How use PROC SGPLOT to display the slope and intercept of a regression line

February 27, 2013
By

A SAS user asked an interesting question on the SAS/GRAPH and ODS Graphics Support Forum. The question is: Does PROC SGPLOT support a way to display the slope of the regression line that is computed by the REG statement? Recall that the REG statement in PROC SGPLOT fits and displays
Read more »

Tags: , ,
Posted in SAS | Comments Off on How use PROC SGPLOT to display the slope and intercept of a regression line

Create a bar chart with an "Others" category

January 14, 2013
By

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
Read more »

Tags: , ,
Posted in SAS | Comments Off on Create a bar chart with an "Others" category

Create a bar chart with only a few categories

January 9, 2013
By

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
Read more »

Tags: , ,
Posted in SAS | Comments Off on Create a bar chart with only a few categories

Show percentages for bar charts with PROC SGPLOT

December 3, 2012
By

It seemed like an easy task. A SAS user asked me how to use the SGPLOT procedure to create a bar chart where the vertical axis shows percentages instead of counts. I assumed that there was some simple option that would change the scale of the vertical axis from counts
Read more »

Tags: ,
Posted in SAS | Comments Off on Show percentages for bar charts with PROC SGPLOT

Visualizing congressional representation by state and time

September 19, 2012
By

With the US presidential election looming, all eyes are on the Electoral College. In the presidential election, each state gets as many votes in the Electoral College as it has representatives in both congressional houses. (The District of Columbia also gets three electors.) Because every state has two senators, it
Read more »

Tags: , ,
Posted in SAS | Comments Off on Visualizing congressional representation by state and time

Visualizing US commute times and congestion

September 10, 2012
By

Robert Allison posted a map that shows the average commute times for major US cities, along with the proportion of the commute that is attributed to traffic jams and other congestion. The data are from a CEOs for Cities report (Driven Apart, 2010, p. 45). Robert use SAS/GRAPH software to
Read more »

Tags: , ,
Posted in SAS | Comments Off on Visualizing US commute times and congestion

What is the difference between categories and groups in PROC SGPLOT?

August 22, 2012
By

The other day I was using PROC SGPLOT to create a box plot and I ran a program that was similar to the following: proc sgplot data=sashelp.cars; title "Box Plot: Category = Origin"; vbox Horsepower / category=origin; run; An hour or so later I had a need for another box
Read more »

Tags: , ,
Posted in SAS | Comments Off on What is the difference between categories and groups in PROC SGPLOT?

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

Sponsors







Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: tal.galili@gmail.com
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.