I have a data set of 167 observations of 3 variables. I am trying to assess and remove multivariate outliers using the robust Mahalanobis distance. To do this I have been playing around with the Moutlier
function from the chemometrics
package.
I am pretty new to R, so I have some questions:
Here is my code:
data<-isotopes
x=data[,c(3:5)] #columns 3-5 contain the data I need to assess
require(robustbase)
res <- Moutlier(data[,c(3:5)] ,quantile=0.975,plot=TRUE)
res
which(res$rd>res$cutoff)
1) Has anyone used this code before, have I done this correctly?
2) Do I need to standardize the data before doing this function, or does it not matter?
3) After using the which
function, the result was:
# [1] 13 28 29 47 79 84 89 91 104 128 153 154
Does this mean that these numbers correspond to observation #13, #28, #29, etc?
So those would be the outliers that I want to remove, for all 3 variables?
Thank you very much to anyone who can help...