winsorZ | R Documentation |
The winsorZ
function identifies outliers based on Z-score cutoff
and replaces with the next most extreme non-outlier value.
This involves z-scoring the variable and identifying/replacing
any cases beyond the z-score threshold.
The winsorZ_find
function is an optional companion
to flag any Z-score outliers to tally as needed.
winsorZ(x, zbound = 3)
x |
The input variable to Winsorize. |
zbound |
The Z-score cutoff (default=3, i.e. outliers are Z>3 | Z<-3). |
Output Winsorized variable
winsorZ(psydat$iq)
## Not run:
psydat %>%
dplyr::select(c(iq, anxT)) %>%
map(winsorZ)
psydat %>% mutate_at(c("iq", "anxT"), list(~ winsorZ(.)))
psydat %>% mutate_if(is.double, list(~ winsorZ(.)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.