Statalist


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

st: RE: Graph of sum results


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: Graph of sum results
Date   Sat, 8 Aug 2009 00:21:42 +0200

<>

***
clear*
set obs 9

//year
gen year=_n+1998

//observations
expand 10
gen profit=rnormal(10000,1000)

//get graph
collapse (mean) profit, by(year)
twoway (line profit year)
***


HTH
Martin

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Samstag, 8. August 2009 00:00
To: [email protected]
Subject: st: Graph of sum results

Hi,
I am trying to make a line plot of the annual mean of a variable for  
the years 1999-2007.
I am using the following command for the means:

bysort  year: sum  profit

How could I make a line plot of the nine means?

Thank you for your help!!
Margie
*
*   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/


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