Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: RE: RE: A modest proposal - missing data doesn't count


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: RE: RE: A modest proposal - missing data doesn't count
Date   Mon, 14 Jun 2010 22:24:18 +0200

<>

Exactly, that is precisely why I always add a -& !mi()- to my comparisons.
Or use -inrange()-, as you suggested earlier.

***********
sysuse auto, clear
cou if rep78>3
cou if rep78>3 & !mi(rep78)
cou if inrange(rep78,4,.)
***********

So still: What is the fuss about?

HTH
Martin


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: Montag, 14. Juni 2010 21:57
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: RE: RE: A modest proposal - missing data doesn't count

The fuss is that 

if x > 10 

includes x >= . Numeric missings all count as larger than any
non-missing numeric value. 

Nick 
n.j.cox@durham.ac.uk 

Martin Weiss

I got used to the -!mi()- thing in "bigger-than" comparisons after a
couple
of errors in this area, and I do not even regard it as a hassle anymore.
What is all the fuss about?

Nick Cox

This comes up on the list, understandably, about once a year. 

I think everybody has some, indeed much, sympathy with the problem, but
no-one ever likes anybody else's solution. 

To make even a case for his new function, Allan has got to show that it
gives sensible answers in all situations in which it might be applied,
and not just inequalities. Just as it's a feature that the name
-value()- is not bespoke, it is also a weakness that it carries no
meaning that is utterly evident and precise. For example, is value(.)
the same or different from value(.a)? Does value(x) < 10 include or
exclude missings? If they're excluded too, then Allan wants a three-way
logic in Stata, and the quickest way to get that is to write your own
clone of Stata. (Allow 25 years.) 

(If this isn't Phil Schumm's point, it's very close.) 

-inrange()- is a well-defined function available for comparisons. I
don't think many people use it, perhaps because its detailed rules don't
stick in one's memory. By the time most people have looked up the syntax
they could write out a longer expression avoiding it. 

I think -value()- could hardly jump such a hurdle. 

Nick 
n.j.cox@durham.ac.uk 

Allan Reese

Feeling aggrieved at years of typing expressions like "if x>10 & x<.",
and feeling sure there must be lots of wrong results from Stata because
users didn't notice that "x>10" includes cases with the missing value,
might I request a new code function?  

The name value() is available. While users would have to remember to use
it, it would quickly become a habit to type "if value(x)>10" etc, with
the effect that the expression would evaluate as true only when x had a
non-missing value.  A check box could be added to the menu interface as
a reminder.    

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index