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 on April 23, and its replacement, statalist.org is already up and running.


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

RE: st: Delete missing


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Delete missing
Date   Sat, 8 May 2010 11:46:07 +0200

<>

I think all the wisdom available from the list re this question is neatly
assembled in http://www.stata.com/statalist/archive/2009-12/msg00506.html


Misha`s solution obviously assumes only numeric variables. A string variable
with missings would lead to

type mismatch
r(109);


The -missing()- function offers an obvious alternative strategy.


HTH
Martin

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Misha Spisok
Sent: Samstag, 8. Mai 2010 08:53
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: Delete missing

It seems like you could loop through all your variables and drop those
with missing values.

local xlist "x1-x100"
foreach var of varlist `xlist'  {
	drop if `var' >=.
}

On Fri, May 7, 2010 at 11:33 PM, Patricia Yu <pyu1@wisc.edu> wrote:
> Dear Stata Users,
>
> I have a question about deleting missing data.
> I would like to delete cases if they have missing values in any variables
in
> my dataset.
> How can I do in STATA to delete these cases with any missing data?
> Could you please share STATA codes with me?
>
> Thank you very much for your great help!
>
> Sincerely,
> Patricia
>
> *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
> PATRICIA YU
> Ph.D. Student & Project Assistant
> Dept. of Educational Leadership & Policy Analysis
> University of Wisconsin-Madison
> Cell: 608/698-8108
> Home: 608/231-6855
> E-mail: pyu1@wisc.edu
> *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
>
>
> *
> *   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/
>

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


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