Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Suggestions for Second Edition of A Visual Guide to Stata Graphics


From   David Radwin <[email protected]>
To   [email protected]
Subject   Re: st: Suggestions for Second Edition of A Visual Guide to Stata Graphics
Date   Thu, 26 Jul 2007 10:22:04 -0700

At 5:45 AM -0500 7/25/07, Fred Wolfe wrote:

Converting proportions to percentages is a frequent task. Maybe adding some lines of code to do simple tasks like this would be helpful.
I concur, and more generally I would like to see more examples using categorical data in graphs, particularly bar graphs or histograms comparing two or more groups. The graphs in the book generally report means, medians, percentages, and sums, but few if any graphs (except pie graphs) report percentages or proportions where the total of the categories (or the total within a group) add to 100% or 1.

In other words, I would like more examples analogous to -catplot- but with greater control over formatting.

There may not be a simple way to create such graphs. For example, recently I tried to produce a graph similar to the "tornado plot" or "population pyramid" at http://www.ats.ucla.edu/stat/stata/Library/GraphExamples/code/twobar4.htm (in the book's appendix) except with the values (bars) for each group (male and female in the above example) adding up to 100% each. I found that -histogram- will give you the correct shape but not enough control to place the labels (percentages) at the ends of the bars. Ultimately my solution was to -collapse- the dataset to calculate the percentages and then to overlap two bar and two scatter graphs, but the coding was not terribly elegant or efficient.

That said, this is still a great book to learn from and I am looking forward to the 2nd edition. Thank you for soliciting suggestions.

David
--
David Radwin, Principal Analyst // [email protected]
Office of Student Research, University of California, Berkeley
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index