Skip to content

Instantly share code, notes, and snippets.

@BrianWeinstein
Created January 29, 2019 17:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
is_outlier <- function(x) {
# Computes a bootstrapped confidence interval
# INPUT:
# x: a numeric vector
# OUTPUT:
# a boolean vector, indicating if each value in x is an outlier
return(x < quantile(x, 0.25) - 1.5 * IQR(x) | x > quantile(x, 0.75) + 1.5 * IQR(x))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment