Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: Make xline on top of graph?


From   Paul Burkander <paul@burkander.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: Make xline on top of graph?
Date   Thu, 21 Jul 2011 12:39:13 -0400

Hi all,
Here's my situation: I have about 5,000 observations and three key
variables, I'll call them var1 var2 and var3.  Each is between 0 and
one and the sum of the three variables is one.

I'd like to have a graph that's sort of like a stacked bar chart to
show the relative proportions of each variable across the 5000
observations.  I've succeeded in doing this by using the twoway bar
option.  I sort on var1, then graph var1+var2+var3, then var1+var2,
then var1.  That part seems to have worked out fine.

However, the 5000 observations fall into three distinct categories,
and I'd like to first sort by these categories then by var1.  I'd like
it to be clear where the demarcation between categories is.  I tried
xline, but it seems to be drawn first, so that my bars are drawn over
top if it and it can only be seen below 0 and above 1.  I don't see
any option to make it be drawn on top.

I also tried "graph combine," but there's a large difference in the
number of observations in each category, and each of my separate
graphs was being drawn with the same width, so the graph was
misleading.

Any ideas?
Thanks,
Paul

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index