Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: recording the first/last non-missing/missing values position


From   Qunzi Zhang <zhangqunzi@googlemail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: recording the first/last non-missing/missing values position
Date   Sun, 4 Nov 2012 20:19:00 +0100

The final goal is to count the nr. non-missing values no matter I
split the sample into two parts according to the time index, i.e.
split samples into one with 1970-1980, the other 1981-1990.

On Sun, Nov 4, 2012 at 8:14 PM, Qunzi Zhang <zhangqunzi@googlemail.com> wrote:
> Dear All,
> I have a dataset as below
>
> date          firm 1   firm2    firm3 .....(permno as identifer index for firm)
> 1970Jan01   1         2      nan
> 1970Jan02   1         2      nan
> ..........................................
> 1990Jan01   1        2        4
> 1990Jan02   1        2        4
>
> .........................................
> 1990Jan01   1      nan       nan
> 1990Jan02   1      nan       nan
>
>
> I would like to store the time/row index for the first(last) nan value and
> the first(last) non-nan value in this data set. Can anyone give me an
> example about how to do this in the do file?
>
> Thanks
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index