[R] Winsorizing Multiple Variables

2009-01-16 Thread Karl Healey
Hi All, I want to take a matrix (or data frame) and winsorize each variable. So I can, for example, correlate the winsorized variables. The code below will winsorize a single vector, but when applied to several vectors, each ends up sorted independently in ascending order so that a given

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

Re: [R] Winsorizing Multiple Variables

2009-01-16 Thread Michael Conklin
-project.org Subject: [R] Winsorizing Multiple Variables Hi All, I want to take a matrix (or data frame) and winsorize each variable. So I can, for example, correlate the winsorized variables. The code below will winsorize a single vector, but when applied to several vectors, each ends up sorted

Re: [R] Winsorizing Multiple Variables

2009-01-16 Thread William Revelle
-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-project.org Subject: [R] Winsorizing Multiple Variables Hi All, I want to take a matrix (or data frame) and winsorize each variable. So I can, for example, correlate