Statalist The Stata Listserver


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

st: Bargraphs, order, SD


From   Knag Anne-Christine <[email protected]>
To   <[email protected]>
Subject   st: Bargraphs, order, SD
Date   Mon, 11 Jun 2007 12:44:24 +0200

Thank you Ulrich.
What do I then do if I want to make simple one-way bargraphs by the same
order? 
The syntax (without the order)

graph bar (mean)  variable1, over (type)

And how can I add SD to the bars?

Thank you!
Anne-Christine




On 6/8/07 9:51 AM, "Ulrich Kohler" <[email protected]> wrote:

> Knag Anne-Christine wrote:
>> By "this order" I meant the order that I have given
>> syntax:
>> generate order = 1 if type== "1C"
>> replace order = 2 if type== "1L"
>> replace order = 3 if type== "1M"
>> replace order = 4 if type == "1E"
>> replace order = 5 if type== "2C"
>> replace order = 6 if type== "2L"
>> replace order = 7 if type== "2M"
>> replace order = 8 if type== "2H"
>> replace order = 9 if type== "2E"
>> 
>> Since the graphs are ordered alphanumerically I need to add an "sort
>> according to order"-command somewhere in the syntax for the plots:
>> 
>> twoway (bar production day_of_prod), ytitle(Production) xtitle(Day of
>> production) by(type)
>> 
>> I also want to include a 10th plot showing the total production of all
>> types.
> 
> How about:
> 
> ----------------------------------------------example.do
> label define order                                ///
>   1 "1C" 2 "1L" 3 "1M" 4 "1E" 5 "2C"              ///
>   6 "2L" 7 "2M" 8 "2H" 9 "2E"
> 
> encode type, gen(order) label(order)
> 
> twoway                                            ///
>  || bar production day_of_prod                    ///
>  || , ytitle(Production) xtitle(Day ofproduction) ///
>       by(order, total)
> ---------------------------------------------------------
> 

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