Thank you for your comment. It's a little bit different. The red coloured point is my sample and blue coloured - its peers. I've generated report with this PCA plot showing that my red point is within the ellipse, while based on mahalanobis distance it can be outside the ellipse.
Happy New Year. Wish you a very successful year!
I am creating PCA plots in R in an automated way and need a script to define whether the sample (red dot on the figure) is outside/within the circle. Does anyone have a good solution for it?
So far I've been using mahalanobis distance...
Thank you for your response. When I am reanalyzing the same data, I do get the same response. So there is no problem there. But if analyze different data, I get a PCA plot of a different format. Please, see the pictures.
What i want is that the ellipse on both plots is located in the center and...