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" <>
To   <>
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
> 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?  

*   For searches and help try:

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