Statalist The Stata Listserver


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

st: The answer: Population-pyramid-like graph - positive barlabels on the left?


From   Gawrich Stefan <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: The answer: Population-pyramid-like graph - positive barlabels on the left?
Date   Tue, 1 Aug 2006 13:38:17 +0200

Took me some time to find out, but the solution to the question I posted
last week is rather simple in the end:

I wanted to create a population-pyramid-like graph for sex-specific cancer
frequencies (sorted by sex-specific rank) with all-positive barlabels):

                  Men                          Women
 
Prostate   ************26********  *********32*************   Breast 
Colon            ********19******  ******24***********        Colon
Lung               *******14*****  ****13********             Lung
Stomach                    ***7**  **6***                     Ovaries  
etc.

(In fact, it's the same double bars but otherwise doesn't have too much in
common with the pop-pyramid.) 


This graph can be done by combining two hbar graphs:
The men's graph is "mirrored" with the "yreverse" option (so that bars go
from right to left without having to use negative numbers). 
The woman's graph has a "xalternative" option, so that category labels are
on the right.

For both sexes, each graph shows the n most frequent disease groups in
frequency order.
I do this by collapsing sex-specific cases by disease category and computing
a descending ranks var, by which the over-var is sorted in the graph
command.


Stefan Gawrich
Hesse State Health Office
Dillenburg
Germany
 

*
*   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