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: List Observations with Missing Values


From   "Joseph Coveney" <jcoveney@bigplanet.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: List Observations with Missing Values
Date   Mon, 13 Aug 2012 13:03:37 +0900

Lisa Wang wrote:

I would like to learn why this is not valid as I get this back from
Stata ">=:  operator invalid r(198)" If I read the help file for that
return code it tells me that the syntax might be incorrectly
specified??

- list c_c e_o e_c if >=. , separator(0) N notrim absolute -

I thought that missing values are represented as a dot in Stata. I
just want Stata to list out all the observations where there are
missing values for those three variables, so I can check, before I
drop these rows with missing observations.

--------------------------------------------------------------------------------

The comparison operator needs two arguments, as in:

list if x >= .  


Try something like the following:

generate byte all_missing = 1
foreach var of varlist c_c e_o e_c {
    replace all_missing = 0 if !missing(`var')
}
list c_c e_o e_c if all_missing, separator(0) N notrim absolute

Joseph Coveney


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