Nick and Ron�n--
Indeed it would be hard to specify a uniformly best parsing of logical
statements that contain missing; the examples below are merely
suggestive of some of the problems you might run into.
di 0|.
di 1|.
di 0&.
di 1&.
di (0|.)!=(1|.)
di max(0,.)!=(1|.)
But the point, IMHO, is that a warning message that says "n missing
values evaluated" or somesuch, meaning n observations had a missing
value in at least one component, would at least remind users to check
their logic to see if they correctly anticipated the implications of
missingness in each component. Were I to pick up the gauntlet Nick
has thrown down (write your own and put it on SSC, in other words), I
would probably also add an option to show an example of one of those
observations and its output in the expression evaluated, and perhaps
to create an indicator for all such observations. Nothing more than a
warning should be expected of Stata, in any case.
On Jan 9, 2008 9:12 AM, Nick Cox <[email protected]> wrote:
> Ron�n is right to remind us that logical (true-or-false) conditions can be
> combined, and I'll say more about this in another post, but
> this example would I think not bite users hard even with a three-way logic
> in which such conditions coould take on possible values of True, False,
> or Missing. Thus
>
> condition | condition | condition | ...
>
> would surely be treated as True if at least one of the conditions
> were True, and as Missing if and only if all the conditions were Missing.
>
> 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/