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

st: Another Stata feature


From   Allan Reese <[email protected]>
To   Stata distribution list <[email protected]>
Subject   st: Another Stata feature
Date   Tue, 6 Jan 2004 11:33:18 +0000 (GMT)

Something which is definitely a feature, being a logical consequence of
the language and documented, is that a missing value for a logical
expression is treated as "true".  However, I tripped over on it and that
made me wonder if it is a dangerous feature - the implication is that any
program must guard against the possibility.  Consider, for example the
consequences of missing data in code such as:

   if wmd invade x

where x is a string variable.

One approach is a self-imposed discipline to make a rigorous logical
variable and test:

   if wmd==1 ...

R. Allan Reese                       Email:     [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