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:

1. b1*x1+b2*x2
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.

Thank you 



---------------------------------


        [[alternate HTML version deleted]]

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to