Statalist The Stata Listserver


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

Re: st: RE: Graphs, pull out random values at peak interval


From   Ulrich Kohler <[email protected]>
To   [email protected]
Subject   Re: st: RE: Graphs, pull out random values at peak interval
Date   Fri, 8 Jun 2007 09:51:37 +0200

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


-- 
Ulrich Kohler
[email protected]
030/25491-361
*
*   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