Statalist The Stata Listserver


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

st: RE: graph box for wide arranged data


From   "Maarten Buis" <M.Buis@fsw.vu.nl>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: graph box for wide arranged data
Date   Wed, 9 May 2007 11:25:27 +0200

--- Stephan Brunow wrote:
> I want to do a graph box where my data is in wide form. For example, every
> observation has information on 3 groups where the information is stored in
> separate variables, say age1 age2 age3.
> If I would reshape the data to long form I could do
>
> .gr box age, over(groupid)
>
> Is there an option to do that with my wide data table or is it necessary to
> reshape the data?


You can do something that is close (see example), and maybe you can tweak it 
to look the same, but I think it is much easier to reshape first.

*------------------- begin example ---------------
webuse grunfeld
graph box invest, over(year) name(over)
keep company year invest
reshape wide invest, i(company) j(year)
graph box invest1935 - invest1954
*-------------------- end example ----------------
(For more on how to use examples I sent to the Statalist, see:
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------



*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index