I am working on finding out outliers using Mahalanobis distance in R. I have a dataset with 30 rows and 24 columns, which I feed into the mahanalobis function from stats package.I want to create find distance of each vector with rest of the rows. The results look good till I export the same input data and same code to another machine and rerun the code, which gives different results than the one seen on machine1. Is this expected behaviour ? or am I missing something. Please advice.
Code I used:
m_dist <- mahalanobis(data[, 2:25], colMeans(data[, 2:25]), cov(data[,2:25]),tol=1e-20)
Then I used boxplot on m_dist to identify the outliers. The result on first machine doesnt match the same on second. I even used set.seed(1007) on both machines just to check, but results are still different
I found another thread which discusses the result difference in python, but it doesnt help me in anyway...