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: nested groups for over (or by) in box graph


From   "Ben Hoen" <[email protected]>
To   <[email protected]>
Subject   st: nested groups for over (or by) in box graph
Date   Fri, 6 Dec 2013 10:17:14 -0500

Hi all,

I have been toying with this and have not been able to solve it.  Hopefully
it will require a simple solution

I would like to use nested groups in an over option with a box graph.

Here is an example:

sysuse auto, clear
egen pricegroup=cut(price), at(0, 5000,10000, 16000) // this creates
discrete groups.  Not what I want but I will use this for the example.
graph box mpg, over(pricegroup) over(foreign)

* ideally I could create nested groups, like the following, and use them
somehow to produce a similar box graph.
g pricegroup1=(price<5000)
g pricegroup2=(price<10000)
g pricegroup3=(price<16000) //i.e. all cases

* I know this next command will not work but this is what I am imagining
might be possible
graph box mpg, over(pricegroup_*) over(foreign)

Any ideas?

As always, thanks in advance,

Ben

Ben Hoen
Staff Research Associate 
Lawrence Berkeley National Laboratory
Office: 845-758-1896
Cell: 718-812-7589
[email protected]
http://emp.lbl.gov/staff/ben-hoen

Visit our publications at: 
http://emp.lbl.gov/reports/re

Sign up for our email list to receive publication notifications at: 
https://spreadsheets.google.com/a/lbl.gov/spreadsheet/viewform?formkey=dGlFS
1U1NFlUNzQ1TlBHSzY2VGZuN1E6MQ





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


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