0

I want to make numeric values into quantile categories in R and until now I used

ntile

function. But I am pretty not sure how this function calculate quantile values like it possesses outliers too or not. Is there any other way to eliminating outliers when obtaining quantile values, please let me know.

Edward M.
  • 221
  • 1
  • 5
  • 13
  • 1
    Can you show us with an example what you mean? – Phil May 24 '17 at 14:37
  • [How to make a great reproducible R example?](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – M-- May 24 '17 at 14:38

1 Answers1

1

Perhaps you just want to know the method of removing values from a dataset before running quantile?

test <- rnorm(100) # Generate data (assuming you can get an outlier)
bp <- boxplot(test) # box plot is a simple way to identify outliers
outlier <- which(test == bp$out) # get the position of those outliers in your data
quantile(test[-outlier]) # remove them as you use the quantile function
Evan Friedland
  • 3,062
  • 1
  • 11
  • 25