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/