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: omitting outliers


From   Sergiy Radyakin <serjradyakin@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: omitting outliers
Date   Mon, 16 Dec 2013 14:46:48 -0500

Selay,
try to use generate flag=1 if ....
to see whether the outliers are really picked up correctly. Then later do
drop if flag==1
Apparently the variables l_F and u_F have some ranking, e.g. l_F is
smaller than u_F. Check whether this is true in the data, if your code
relies on this assumption.
Best, Sergiy


On Mon, Dec 16, 2013 at 2:33 PM, Selay Sahan <selays@outlook.com> wrote:
> Dear Statalisters,
>
> In order to find and omit the outliers from the data, I used the code below:
>
>
> sort nace
> by nace: lv mpg
> by nace: keep if inrange(mpg,r(l_F)-(1.5*(r(u_F) - r(l_F))) ,r(u_F)+(1.5*(r(u_F) - r(l_F))))
>
>
> However, although Stata finds the outliers, it does not drop them from the sample.
>
> ((I tried the code with simpler data sets. It worked well, i.e. the outliers were found and dropped from the sample))
>
>
> Does anyone know why Stata does not drop the outliers although it is able to find them?
>
> What may be wrong with my data set? (The code is working, as I've said I checked it with other smaller data sets)
>
> Any help will be greatly appreciated. Thank you in advance.
>
> Selay
>
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index