[R] Plots from lda and predict.lda

From: Mat Vanderklift <m.vanderklift_at_ecu.edu.au>
Date: Mon 02 Apr 2007 - 03:13:56 GMT

Dear all

When plotting the results of lda and predict.lda, I expect the axis dimensions to remain essentially the same - predict.lda projects new observations onto linear discriminants. However, I am getting different ranges of values along the x-axis when producing plots following each: plot(lda) yields values in the range approximately -3 to +4, while plot(predict.lda) yields values for the first linear discriminant in the range approximately +4 to +10 (the commands follow). Could anybody suggest what is happening here? (I can attach files with plots separately if requested).

Mat Vanderklift

> library(MASS)
> Sep04 <- read.table("Sep04 dataframe.txt", header=TRUE)
> trainSep04 <- Sep04[1:125,]
> Sep04.lda <- lda(Reef ~ ., trainSep04, prior=c(1,1,1,1,1,1,1)/7)
> plot(Sep04.lda, dimen=2)
> predict.Sep04 <- predict(Sep04.lda, Sep04)
> plot(predict.Sep04$x[1:125,], main="September 2004", xlab="first linear
discriminant", ylab="second linear discriminant")

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon Apr 02 13:23:55 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 02 Apr 2007 - 04:30:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.