[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: Windorization
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,
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'
> Would it be possible to let me
> know the answer for the following specific winsorization job:
> 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: