Page 1 of 1

Winsorize data set

Posted: Thu Jan 03, 2019 12:14 pm
by imansur
Are there RATS codes available to winsorize the data? If so, can anyone share the codes with me.
Thank you,
Monty Mansur

Re: Winsorize data set

Posted: Thu Jan 03, 2019 2:40 pm
by TomDoan
This would truncate values at the 5 and 95% values:

set x 1 1000 = %rant(5.0)
stats(fract) x
set xw 1 1000 = %if(x<%fract05,%fract05,%if(x>%fract95,%fract95,x))
print(smpl=x<>xw) / x xw

Re: Winsorize data set

Posted: Thu Jan 03, 2019 4:01 pm
by imansur
Thank you Tom for your prompt response. Appreciate it.
Monty