Statalist The Stata Listserver


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

Re: st: na.omit synonym


From   "Neil Shephard" <[email protected]>
To   [email protected]
Subject   Re: st: na.omit synonym
Date   Wed, 20 Jun 2007 14:19:52 +0100

On 6/20/07, Kit Baum <[email protected]> wrote:
Neil said

Looping over the observations will do it...

* Convert -1 to Stata's internal missing for your variables
mvdecode a b c d, mv(-1)

* Loop over variables and drop if they are missing
foreach x in varlist a b c d{
   drop if(`x' == .)
}


For one thing I would not describe this as 'looping over the
observations'. It is not an explicit loop (which is generally to be
avoided).
Ooops, I did of course mean what I wrote in the comment as opposed to
at the start., i.e. loop(ing) over variables.

Apologies for any confusion this may have caused.

Neil
--
"In mathematics you don't understand things. You just get used to
them."  - Johann von Neumann

Email - [email protected] / [email protected]
Website - http://slack.ser.man.ac.uk/
Photos - http://www.flickr.com/photos/slackline/
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index