Statalist The Stata Listserver


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

st: missing values included in conditions


From   "Zurab Sajaia" <zsajaia@hotmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: missing values included in conditions
Date   Fri, 08 Sep 2006 11:36:15 -0400

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?

Thanks again,
Zurab


*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index