--- Ulrich Kohler wrote:
> . egen meanwage = mean(wage), by(yearofbirth)
> . scatter meanwage yearofbirth
>
> is one possibility. The advantage of this solution is that it keeps your
> data as it is. The disadvantage is that the file size of the graph
> becomes arbitrary large if you have many observations.
>
> A solution that destroys the data in memory but produces smaller graphs
> (in terms of bandwidth) is
>
> . collapse (mean) wage, by(yearofbirth)
> . scatter wage yearofbirth
An intermediate solution that will get the small graph while keeping the
data intact is:
. bys yearofbirth (wage): gen byte first = _n == 1
. egen meanwage = mean(wage), by(yearofbirth)
. scatter meanwage yearofbirth if first
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/