From: array chip (email@example.com)
Date: Wed 02 Apr 2003 - 08:14:47 EST
I used the "lda" function in the MASS library of S-Plus (R) to do a linear discriminant analysis, and got the linear coefficients, say b1 and b2 for the 2 predictors x1 and x2. I have trouble to calculate the discrimiant scores for each observation, I used 3 ways to try to repeat the scores returned by the "predict" function in S-Plus:
2. b1*(x1-mean of x1)+b2*(x2-mean of x2)
3. b1* standardized x1+b2*standardized x2 (standardize: mean 0 & variance 1)
none of the above procedures can repeat the scores returned by the "predict" function. However, method 2 & 3 can predict the classes correctly if using 0 as cutoff, juts like using the "predict function".
What should be the correct formula to compute the scores for each observation?
BTW, how to retrieve the linear coefficients from an lda object? I can't retrieve it by using @coef, @coefficients, etc.
[[alternate HTML version deleted]]
Rfirstname.lastname@example.org mailing list
This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:35 EST