View source: R/epi_stats_count_outliers.R
epi_stats_count_outliers | R Documentation |
epi_stat_count_outliers() counts how many outliers a vector has using a univariate approach. Returns the number of observations that are greater than the cutoff. Outliers are detected with the Tukey method (above and below coef * IQR).
epi_stats_count_outliers(num_vec = NULL, coef = 1.5, ...)
num_vec |
Numeric vector to test. |
coef |
Coefficient for outlier detection, default is 1.5 |
... |
Other parameters that can be passed to boxplot.stats(). |
Returns the number of observations above the cut-off specified.
coef = 0 returns no outliers, see ?boxplot.stats An alternative, not implemented, is to consider those eg > 5 * SD
Antonio J Berlanga-Taylor <\url{https://github.com/AntonioJBT/episcout}>
boxplot.stats
## Not run:
n <- 1000
df <- data.frame(var_id = rep(1:(n / 2), each = 2),
var_to_rep = rep(c("Pre", "Post"), n / 2),
x = rnorm(n),
y = rbinom(n, 1, 0.50),
z = rpois(n, 2)
)
epi_head_and_tail(df)
epi_stat_count_outliers(num_vec = df$x, coef = 0)
epi_stat_count_outliers(num_vec = df$x)
summary(df$x)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.