Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Re: List Observations with Missing Values


From   "Joseph Coveney" <[email protected]>
To   <[email protected]>
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index