Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: From: Qunzi Zhang <[email protected]>
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: From: Qunzi Zhang <[email protected]>
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
http://www.stata.com/statalist/archive/2012-11/msg00024.html
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
"nan".
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.
Nick
On Sun, Nov 4, 2012 at 6:17 PM, <[email protected]> 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:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/