Statalist


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

Re: Re: st: making sure on the graph


From   Nirina F <fstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: Re: st: making sure on the graph
Date   Fri, 4 Sep 2009 10:40:08 -0400

Very helpful! many thanks

On Fri, Sep 4, 2009 at 9:44 AM, Maarten buis<maartenbuis@yahoo.co.uk> wrote:
> --- Maarten buis wrote:
>> > 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
>
> --- Nick Cox wrote:
>> Maarten's solution is good, but there is no need for the
>> sorting within -yearofbirth-
>
> This is correct. My solution came directly from my default
> library of tricks. In a general case this will make sure
> that first will tag an observation that has a valid
> (non-missing) value on whatever I am sorting on, in this
> case wage, unless all values of wage are missing within a
> category of yearofbirth. This is not relevant in this
> case as meanwage will always contain valid values.
>
> -- 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/
>

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