Winsorize data set

If you are seeking RATS code for implementing a particular technique or replicating results from a paper, post your request here. Be sure to include complete citations for any papers or books.
imansur
Posts: 6
Joined: Tue Nov 08, 2016 1:58 pm

Winsorize data set

Unread post by imansur »

Are there RATS codes available to winsorize the data? If so, can anyone share the codes with me.
Thank you,
Monty Mansur
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Winsorize data set

Unread post 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
imansur
Posts: 6
Joined: Tue Nov 08, 2016 1:58 pm

Re: Winsorize data set

Unread post by imansur »

Thank you Tom for your prompt response. Appreciate it.
Monty
Post Reply