0

I have a discriminant function for y but I need to plot it in the coordinate axes (x1, x3) along with the data. How do I do that on R?

> fdmin13.lda
Call:
lda(min13[, 5] ~ min13[, 1] + min13[, 3], data = min13)

Prior probabilities of groups:
        0         1 
0.4666667 0.5333333 

Group means:
   min13[, 1] min13[, 3]
0 -0.06904762   1.366667
1  0.23916667   2.682500

Coefficients of linear discriminants:
                 LD1
min13[, 1] 2.2060444
min13[, 3] 0.9920244

min13[,1] is x1 and min13[,3] is x3. How do I plot the discriminant function on the plot of the data points? Thanks for your help!

hello
  • 37
  • 9
  • Does this answer your question? [How to plot classification borders on an Linear Discrimination Analysis plot in R](https://stackoverflow.com/questions/30619616/how-to-plot-classification-borders-on-an-linear-discrimination-analysis-plot-in) – polkas Oct 24 '20 at 20:04
  • I tried it but I don't get the answer that I want. I keep getting errors such as "Warning message: In matrix(prd, nrow = np, ncol = np) : data length [90000] is not a sub-multiple or multiple of the number of rows [69]" – hello Oct 25 '20 at 16:35

0 Answers0