Created
January 29, 2019 17:05
-
-
Save BrianWeinstein/c121f2276bddc9833b0cac4251acf635 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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