Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Re: NaN (the inedible kind)


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: NaN (the inedible kind)
Date   Sat, 28 Sep 2002 15:23:37 +0100

Christopher F Baum
 
> NaN is geekspeak for Not a Number. See
> 
> http://www.psc.edu/general/software/packages/ieee/ieee.html
> 
> IMHO Stata does NOT make use of NaNs, which have the 
> properties that 
> missing values should have (i.e. any op involving a NaN 
> evaluates to a NaN). If I say
> 
> use auto
> g byte badrep = (rep78>3)
> 
> I get 5 obs of badrep=1 corresponding to rep78==. whereas 
> in true NaN 
> arithmetic they would be discarded as having no defined 
> value. 

The example is convincing, but note that we have 
some smart behaviour elsewhere in Stata. Thus 

di max(1,2.71828,3.14159,.) 

yields 3.14159. The result of -max()- is missing if and
only if all its arguments are missing. I'd say that 
was right, at least in the important sense that 
is what is usually desired. 

Now substitute NaN for missing. What should the 
answer be?  

Nick 
[email protected] 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index