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]

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


From   Phil Schumm <pschumm@uchicago.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: A modest proposal - missing data doesn't count
Date   Mon, 14 Jun 2010 13:09:03 -0500

On Jun 14, 2010, at 11:52 AM, Allan Reese (Cefas) wrote:
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.


So, you're proposing that value(.) evaluate to a number smaller than mindouble()? What about value(.) < value(.a), should that evaluate to True? If so, then the function might more aptly be named sasval(), since in effect what it would be doing is treating missing values the way they're treated in SAS. Of course, while that would enable you to type expressions like

    if 10 < x

without thinking about missing values, it would then mean that you would have to start thinking about missing values every time you typed

    if x < 10

So, you'd address one issue, but create another.


-- Phil

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