Statalist The Stata Listserver


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

Re: st: Re: Re: na.omit synonym


From   "bunny , lautloscrew.com" <[email protected]>
To   [email protected]
Subject   Re: st: Re: Re: na.omit synonym
Date   Wed, 20 Jun 2007 16:31:22 +0200

hmm,

it looks like it would work though :) . sure there are many ways, probably some drop if with and/or and all variables would also work...
i just thought there's a syntax that drops all missings directly. in a way this is what neil suggested....

thx everybody!!

matthias
Am 20.06.2007 um 15:38 schrieb Michael Blasnik:


...
Woops, my suggestion will only work after you recode -1 to missing.


----- Original Message ----- From: "Michael Blasnik" <[email protected]>
To: <[email protected]>
Sent: Wednesday, June 20, 2007 9:12 AM
Subject: st: Re: na.omit synonym



...I have no knowledge of R, but it sounds like this is one (of many) ways to get what you want:

gen byte touse=1
markout touse var1 var2 var3

will create a variable named touse which contains 1s for cases with no missing values in var1, var2, or var3, and zeros otherwise. You can then use -if touse- after most commands or just -drop if touse- to actually drop them from the dataset.

Michael Blasnik

----- Original Message ----- From: "bunny , lautloscrew.com" <[email protected]>
To: <[email protected]>
Sent: Wednesday, June 20, 2007 7:41 AM
Subject: st: na.omit synonym



HI everybody,

i have several non-response in my dataset that are coded -1 .
i�d like to drop any observation (row) where one or more columns contains a -1.
*
*   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/

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