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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Missing observations


From   Csaba <csaba.kertai@hotmail.co.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Missing observations
Date   Thu, 20 Jun 2013 16:41:06 +0200

Nick,

Thank you for your reply. Yes you are right I muddled up observations with values. I meant to write values not observations. My problem is that if I use 'drop if missing(var2)' that will drop values for each variable in my data set. 

I need to compare the means/medians of 2 variables. Var1 has 1125 non-missing values, var2 has 169 non-missing values. I might be doing sth wrong but when I try using bootstrapping I get a message saying that I should drop any missing values as bootstrapping cannot distinguish between missing and non-missing values. That's why I want to drop missing values for Var2. Basically, I want to achieve the same result as with the unpaired two-sample mean comparison test but with bootstrapping. 

Thanks a lot!

On 20 Jun 2013, at 12:32, Nick Cox <njcoxstata@gmail.com> wrote:

> -drop- as used here drops entire observations (outside Stata
> observations are known as rows, cases, records). You seem to be under
> the impression that there is an operation
> 
> drop missing values
> 
> that is somehow different from
> 
> -drop- observations
> 
> but I don't know what that would look like.
> 
> In your example if -var2- has only 169 non-missing values (_not_
> observations) then
> 
> drop if missing(var2)
> 
> will leave precisely 169 observations. I don't understand how that is
> a surprise or what else you want.
> 
> Nick
> njcoxstata@gmail.com
> 
> 
> On 20 June 2013 11:17, Csaba Kertai <csaba.kertai@hotmail.co.uk> wrote:
> 
>> I need a bit of help with dropping missing observations. If I use 'drop if missing(var)' or drop if 'var'==. etc. many other observations are dropped as well. More precisely, var1 has 1125 observations and var2 has 169 observations. I want to drop missing observations for var2 but if I use drop if var2==. then this will keep only 169 observations for each variable. I only want to drop values that are missing.
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index