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

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


From   David Kantor <[email protected]>
To   [email protected]
Subject   RE: Missing as true - Was: Re: st: RE: Another Stata feature
Date   Thu, 08 Jan 2004 10:32:55 -0500

At 09:45 AM 1/8/2004 -0500, Bill Rising wrote:
On 1/8/04 6:50, Nick Cox wrote

[snip...]

If the lazy evaluation model were used, 'or' would be true as long as at
least one is true, and 'and' would be false if at least one is false.
Extending this with the normally unnecessary extensions that 'or' is
false if all are false, and 'and' is true if all are true would give a
nice logical way to work.

>
>1. fill in truth tables
>
&                 true  false irrelevant
true                T     F      I
false               F     F      F
irrelevant          I     F      I
>
|                 true  false irrelevant
true                T     T      T
false               T     F      I
irrelevant          T     I      I

This still keeps the !(A|B) = (!A) & (!B) and the !(A&B) = (!A) | (!B)
working fine, as well as the distributive laws.
[...]
I should add that what Bill refers to is three-valued logic, for which I have written some egen functions. See the trinary package; -findit trinary-

(These force you to compose logical expressions as functions, and complex expressions would have to be done in pieces.)

I have a back-burner project to enhance these with a kind of logic that distinguishes at least two types of missing: unknown and vacuous. I will hopefully get to work on these some day.

Also R. Allan Reese wrote:

Stata implements value+missing -> missing
> value*missing -> missing
> and
> value / 0 -> missing
> so why should
> value>0 -> 1, when value is missing
> be a sacred cowpat?

I agree that to have missing>0 being true is a questionable decision; I would have had it yield missing. But that is a separate issue from how to interpret a missing value in a "controlling" context -- i.e. as the argument to an -if- (qualifier or command).

do_something if value

if value {
do_something_else
}

-- where value is missing. This is a separate issue, and I'm not sure what would have been the best course. I once suggested that this ought to be an error condition, but that stirred up some strong disagreement. More can be said on this, but let's leave that for now.

Let us suppose that Stata were tweaked so that (missing) > (some_actual_value) yielded missing. (And this would hold for any of the comparison operators -- though I'm not sure what to do with ==.)

Suppose, too, that the rule that a missing value in a controlling context is taken as true still holds -- that that feature were not altered.

Then a command such as
regress y x1-xN if age>60

would still include the cases where age is missing.

----

No answers; just some things to keep in mind.
-- David


David Kantor
Institute for Policy Studies
Johns Hopkins University
[email protected]
410-516-5404

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