From | Roger Newson <[email protected]> |
To | [email protected] |
Subject | Re: st: Re: NaN (the inedible kind) |
Date | Thu, 26 Sep 2002 15:23:24 +0100 |
At 08:18 26/09/02 -0400, Kit Baum wrote:
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 sayThanks to Bill Gould and Kit Baum for their very informative answers to my query. If Stata ever decides to go over to supporting NaNs, then it looks like it would be a good idea also to support +Inf and -Inf as well, because these often appear in applied statistics as confidence limits (eg for odds ratios and Hodges-Lehmann median differences).
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. (As the IEEE std says, there are differences between three constructs, none of which can be represented in finite arithmetic: NaN, +Inf, and -Inf). To do this right in Stata, I would have to say
g byte badrep = (rep78>3 & rep78<.)
and forgetting the second clause will bite you (well, in this case maybe byte you).
Most lower-level programming languages (and some higher-level languages, e.g. Mathematica, MATLAB) support NaNs per the IEEE standard. Stata does not--it allows missing values to be treated as a very large positive number--and that has been the topic of discussion at 'wishes and grumbles' sessions at SUG meetings.
I don't know whether Bill Gould is saying that tabstat's 'magic number' behavior is inappropriate, but it is established and well defined. Nick Cox and I mimicked it in statsmat. It is very useful to be able to indicate that a certain matrix cell is not zero but rather not defined.
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |