This post uses ggplot2 and rCharts to modify a grouped bar chart that appeared in an article that appeared online on October 19, 2014 in Wall Street Journal’s site. The article was titled “How to Sell a Liberal-Arts Education”. The code for the Rmarkdown file that generated this post can be found on github.
The article used the following grouped bar chart.
The intent of the graph is two fold.
1) To facilitate a comparison between the number of different bachelor’s degrees awarded, and
2) To facilitate a comparison between the percentage of students awarded with different bachelor’s degrees.
(One might also question whether the demand for a degree is accurately reflected by number of degrees awarded.)
The grouped bar chart is designed to facilitate a comparison between different sub groups of a main group. That said, the construction of the graph gets the eye to compare the lengths of the differently colored bars within each degree. For example within Business, one would seek a comparison between the length of the two bars for 366,815 and 20.85%, a comparison anyone would deem to be meaningless.
This is the first attempt at modifying that graph, which is motivated by an example from Stephen Few.
The percentages we find in our calculation do not match up with what the original chart shows. In fact, percentage numbers from WSJ’s chart add up to 82.7%. They either did not include a catch-all “Other Degrees” category or did not compute the numbers correctly. In either case, there is an issue. [82.7% of 1792273.277 happens to be 1482210, the sum of students who graduated from degrees listed in the graphic. Thus, approximately 310063 students graduated with other degrees.]
There is redundancy built in to the two plots and not much new information is gained, despite using a lot of space. I prefer the cleaner single-chart look. Here’s the last iteration of the static version, which is slightly different from the first version shown above.
Interactive Version (Please hover over the bars for information)