Description Usage Arguments Value Examples
Function removes outliers for a given set of variables at a relative percentage at both ends.
1 | removeOutlierObservations(df, variables = colnames(df), cutoff = 0.5)
|
df |
Data frame, matrix or tibble with input variables |
variables |
Variables used for trimming. By default, all variables are included. |
cutoff |
Relative cutoff on each side in percent (default: |
Returns vector with indices of the observations to be removed.
1 2 3 4 5 6 7 8 9 10 | d <- data.frame(x1 = rnorm(200), x2 = rnorm(200), y = rnorm(200))
d_trimmed <- removeOutlierObservations(d)
dim(d_trimmed)
d_trimmed <- removeOutlierObservations(d, variables = "y", cutoff = 2.0)
dim(d_trimmed)
d_trimmed <- removeOutlierObservations(d, variables = c("x1", "x2"), cutoff = 2.0)
dim(d_trimmed)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.