Displaying 1 result from an estimated 1 matches for "wisor".
Did you mean:
wiser
2009 Jan 16
2
Winsorizing Multiple Variables
...but when applied to
several vectors, each ends up sorted independently in ascending order
so that a given observation is no longer on the same row for each
vector.
So I need to winsorize the variable but then return it to its original
order. Or another solution that will take a data frame, wisorize each
variable, and return a new data frame with all the variables in the
original order.
Thanks for any help!
-Karl
#The function I'm working from
win<-function(x,tr=.2,na.rm=F){
if(na.rm)x<-x[!is.na(x)]
y<-sort(x)
n<-length(x)
ibot<-floor(tr*n)+1...