Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: missing values included in conditions


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: missing values included in conditions
Date   Fri, 8 Sep 2006 16:58:35 +0100

This one is not weird at all (in Stata terms). 

Missing is not zero. That is the beginning and end of it. 

Considered as inputs, in Stata, 
	not 0 <-> true 
	0     <-> false 

Considered as outputs, in Stata, 
	1 <-> true
	0 <-> false 

That is all you need to know, but the story is explained at excruciating length in 

FAQ     . . . . . . . . . . . . . . . . . . . . . . .  True and false in Stata
        2/03    What is true and false in Stata?
                http://www.stata.com/support/faqs/data/trueorfalse.html

The alternative would be some three-valued logic, in which missing was something
else (or ignored). Many people would prefer that, but even those who would prefer that 
can't seem to agree what it should be. Clearly there are many contexts in which 
missings are ignored, but this isn't one of them. 

At the first Boston users' meeting, David Kantor gave a talk on one 
possibility, which provoked a very lively (but inconclusive) discussion. 
Fortuitously, that was followed by a talk on circular arguments. 

Nick 
[email protected] 

Zurab Sajaia
 
> And another weird thing I just noticed and wanted to confirm 
> that it's my 
> mistake not Stata's :)
> 
> 
> lets suppose we have a variable cond
> 
>     cond
>        1
>        1
>        0
>        0
>        0
>        .
> 
> if I write
> 
> .. count if cond==1
> 
> it will of course return 2. But using
> 
> ..count if cond
> 
> gives result 3, as Stata includes missing in count as well. 
> Somehow I was 
> thinking that these two approaches were equivalent (and 
> missings are always 
> excluded) but was proven wrong.
> 
> So should missings be treated as "True" in this kind of conditions?

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