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, is already up and running.

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

Re: st: From: Qunzi Zhang <>

From   Nick Cox <>
Subject   Re: st: From: Qunzi Zhang <>
Date   Sun, 4 Nov 2012 19:24:26 +0000

It;'s a very good idea to give a title or subject for your postings.
This point was made, if by example rather by exhortation, in a reply
to your earlier post. See

I guess nan is implying "not a number", and so a missing value. Some
software documentation uses "NaN", but Stata doesn't use this term.

But whatever it, is the first occurrence of "nan" is just the minimum
over all the first times for which each firm variable takes the value

If "nan" does mean missing, and if I understand you correctly, you could go

egen nmissing = rowmiss(firm*)
su date if nmissing > 0

to get the minimum date for the first nan.

Although you were adamant in the earlier thread that you want this
data structure, it only makes problems like this more difficult.


On Sun, Nov 4, 2012 at 6:17 PM,  <> wrote:

> 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 nan value and
> the first non-nan value in this data set. Can anyone give me an
> example about how to do this?
*   For searches and help try:

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