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: technical question on the removal of outliers


From   Eric Booth <[email protected]>
To   "<[email protected]>" <[email protected]>
Subject   Re: st: technical question on the removal of outliers
Date   Sat, 26 Feb 2011 22:12:53 +0000

<>

You could drop these obs using the loop below, but instead of dumping observations where some value is in the p1 or p99, how about just flagging them for exclusion in the regression?  
Also, there are better methods for investigating outliers than just dropping any value in p1 or p99, here's a good starting place:  http://www.ats.ucla.edu/stat/stata/webbooks/reg/chapter2/statareg2.htm  

******!
sysuse census, clear
unab iv_list :  pop*  medage death marriage
reg divorce `iv_list'
est sto one

***flag p1 or p99 obs.
g flag = .
foreach v in `iv_list' {
	qui su `v', d
	**you could change the line below to -drop-**
	replace flag = 1 if `v'<=r(p1) | `v'>=r(p99)
	}

**reg w/o p1 or p99 obs.
reg divorce `iv_list' if flag!=1
***

est sto two
***compare:
est table one two, b(%7.4f) se stats(N r2)
*******!

- Eric
__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]
Office: +979.845.6754

On Feb 26, 2011, at 3:26 PM, <[email protected]>
 wrote:

> Dear all, 
> 
> 
> is there a possibility to remove outliers in the highest 99th and lowest 1st 
> percentile in stata before running regressions? I proceed currently by using 
> sum, varlist, det after which I manually drop these observations. 
> 
> 
> However it is rather time consuming when one needs to run a lot of regressions. 
> I would be glad if you could share such stata command with me. 
> 
> 
> Best,
> Rado
> 
> 
> 
> *
> *   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