wins {tsutils} | R Documentation |
Winsorise
Description
Winsorise either by number or percentage of observations.
Usage
wins(x, p = 0.05)
colWins(x, p = 0.05)
rowWins(x, p = 0.05)
Arguments
x |
input data. NAs will be removed. |
p |
percentage or number of observations to be winsorised. If value is <1 then it is used as a percentages. Otherwise it is the number of observations to winsorise. If the resulting p > floor((length(x)-1)/2), then it is set equal to floor((length(x)-1)/2). |
Value
Winsorised vector.
Functions
-
colWins()
: Vectorised version of wins by columns. -
rowWins()
: Vectorised version of wins by rows.
Author(s)
Nikolaos Kourentzes, nikolaos@kourentzes.com.
Examples
x <- rnorm(100,mean=0,sd=1)
xW <- wins(x)
[Package tsutils version 0.9.4 Index]