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]

RE: st: Delete missing


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
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: [email protected]
[mailto:[email protected]] On Behalf Of Misha Spisok
Sent: Samstag, 8. Mai 2010 08:53
To: [email protected]
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 <[email protected]> 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: [email protected]
> *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
>
>
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index