[R] Decision boundaries for lda function?

Thomas Larsen tl at leibniz.uni-kiel.de
Wed Aug 5 10:56:34 CEST 2009


I am using the lda function from the MASS library. I would to find the
decision boundaries of each class and subsequently plot them. I wonder if
anybody can offer any help on this topic? 

Below I applied the lda function on a small dataset of mine. 

Any help will be much appreciated.

> library(MASS)

> AA<-read.table("http://www.natursyn.dk/online/fingerprinting.txt",header=T)

> aa.lda<-lda(as.matrix[3:9],AA$group) 
> aa.ld<-predict(aa.lda,dimen=2)$x 
> eqscplot(aa.ld,type="n",xlab="LD1", ylab="LD2",las=1) 
> text(aa.ld,c(rep('f',13),rep('b',10),rep('p',10)))

> aa.mean<-lda(aa.ld,AA$group)$means 
> points(aa.mean,pch=3) 

Thomas Larsen

Leibniz-Laboratory for Stable Isotope Research
Max-Eyth-Str. 11-13, 24118 Kiel, Germany
Work: +49-431-880-3896
View this message in context: http://www.nabble.com/Decision-boundaries-for-lda-function--tp24823213p24823213.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list