title: Quadratic Discriminant Analysis (QDA) plot in R
body: <p>I am trying to plot the results of Iris dataset Quadratic Discriminant Analysis (QDA) using MASS and ggplot2 packages. The script show in its first part, the Linear Discriminant Analysis (LDA) but I but I do not know to continue to do it for the QDA. The objects of class &quot;qda&quot; are a bit different from the &quot;lda&quot; class objects, for example: I can not find the Proportion of trace/X% of explained between-group Variance/discriminant components and can not add them to the graph axes. Any help or ideas how to code this graph using ggplot2?</p>
  <p>Code:</p>
  <pre><code>require(MASS)
  require(ggplot2)
  require(scales)
   
  
  irislda &lt;- lda(Species ~ ., iris)
  prop.lda = irislda$svd^2/sum(irislda$svd^2)
  plda &lt;- predict(irislda,   iris)
  
  datasetLDA = data.frame(species = iris[,&quot;Species&quot;], irislda = plda$x)
  ggplot(datasetLDA) + geom_point(aes(irislda.LD1, irislda.LD2, colour = species, shape = species), size = 2.5) + 
      labs(x = paste(&quot;LD1 (&quot;, percent(prop.lda[1]), &quot;)&quot;, sep=&quot;&quot;),
         y = paste(&quot;LD2 (&quot;, percent(prop.lda[2]), &quot;)&quot;, sep=&quot;&quot;))
  
   
  irisqda &lt;- qda(Species ~ ., iris)
  pqda &lt;- predict(irisqda,   iris)
  datasetQDA = data.frame(species = iris[,&quot;Species&quot;], irisqda = pqda$posterior) 
  ggplot(datasetQDA) + geom_point(???, ???, colour = species, shape = species), size = 2.5)
  </code></pre>