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

Missing as true - Was: Re: st: RE: Another Stata feature


From   Bill Rising <[email protected]>
To   "Stata Listserve" <[email protected]>
Subject   Missing as true - Was: Re: st: RE: Another Stata feature
Date   Wed, 7 Jan 2004 17:04:03 -0500

On 1/7/04 14:29, Nick Cox wrote

>I have a problem decoding this, even setting
>aside an example of Allan's puckish sense of humour.
>
>One can certainly be bit by forgetting that
>
>	<expression evaluating to numeric missing>
>
>qualifies as true. This may not be what you want,
>but the point is very well documented.

It is well documented, and I suspect that there is a good internal coding 
reason for it, since C assumes that non-zero (i.e. any bit non-zero) is 
true, and missing values have non-zero bits. Still, it would make Stata 
code easier to read and less prone to error if people could code the 
incorrect

regress foo bar if snafu

instead of the correct

regress foo bar if snafu & snafu < .

for snafu being some sort of indicator which could be missing. 

I've used Stata long enough that the latter comes natural to me. Still, 
I'd hate to see how many analyses have been found invalid because of 
folks forgetting the extra 'less than missing' clause.

Bill
*
*   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