0

I am creating a PCA model in R and would like to know whether my sample (red) is within or outside the ellipse. Could you maybe help me how to do that?

At the moment I am using Mahalanobis distance, but in some cases it predicts wrongly, since it is in a multivariate space and here I use only two principal components.

The code i am using to create a plot:

  plt <- autoplot(
      pcaAroma, 
      data = keepRows,
      colour = 'Woi',
      frame.type = 'norm',
      type = "cairo",
      res=100,
      size = 4
  )

Image

user3640617
  • 1,546
  • 13
  • 21
JTim
  • 1
  • 2
  • You should provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data. How is the ellipse defined? Give an example where your method fails. – MrFlick May 30 '17 at 13:03
  • could not find a reasonable way to upload the data, so will leave it AS IS for now. – JTim May 31 '17 at 13:40

0 Answers0