<>
If you do find the idea of -collapse- destroying your original data creepy,
you can of course -preserve- and -restore-, or go the -graph dot- route:
***
clear*
set obs 9
//year
gen year=_n+1998
//observations
expand 10
gen profit=rnormal(10000,1000)
//get graph
graph dot (mean) profit, over(year)
***
HTH
Martin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Samstag, 8. August 2009 00:22
To: [email protected]
Subject: st: RE: Graph of sum results
<>
***
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/
*
* 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/