Re: [R] Winsorizing Multiple Variables

2009-01-16 Thread William Revelle
Thanks to Michael for giving a nice solution to Karl's question . This identified a bug in the psych package winsor function which has now been fixed in version 1.0.63. (The current development version). Although my winsor.means function in 1.0..62 (and ealier) worked correctly, my winsor fu

Re: [R] Winsorizing Multiple Variables

2009-01-16 Thread Michael Conklin
Don't sort y. Calculate xbot and xtop using xtemp<-quantile(y,c(tr,1-tr),na.rm=na.rm) xbot<-xtemp[1] xtop<-xtemp[2] -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Karl Healey Sent: Friday, January 16, 2009 2:51 PM To: r-help@r-proj

Re: [R] Winsorizing Multiple Variables

2009-01-16 Thread David Winsemius
Might work better to determine top and bottom for each column with quantile() using an appropriate quantile option, and then process each variable "in place" with your ifelse logic. I did find a somewhat different definition of winsorization with no sorting in this code copied from a Patri