Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Windorization


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: Windorization
Date   Sun, 20 Jun 2004 14:59:46 +0100

This isn't Winsorization, and -winsor- 
won't help. Your two specifications 
here are not the same unless 4 = 1, 
but the Stata technique is the same and requires 
no special program. For example, 

su myvar 
local upper = `r(mean)' + 4 * `r(sd)' 
local lower = `r(mean)' - 4 * `r(sd)' 
gen myvar2 = myvar 
replace myvar2 = `upper' if myvar > `upper' & myvar < . 
replace myvar2 = `lower' if myvar < `lower' 

Nick 
[email protected] 

gary tian
 
> Would it be possible to let me
> know the answer for the following specific winsorization job: 
> truncating
> time series at 4 standard deviations from the mean, setting 
> these outside
> the range equal to the boundary value, in other words, the series is
> winsorized by replacing all these outside the range [mean +/- standard
> deviations] with these boundary. 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index