[R] lda: scaling to 'disctiminant function'

From: Worik Turei stanton <turwa720_at_student.otago.ac.nz>
Date: Mon 25 Jul 2005 - 11:03:06 EST


Friends

Briefly...

In the documentation for lda in MASS it describes the value 'scaling' as 'a matrix which transforms observations into discriminint functions...'.

How?

Verbosely...

I have a matrix of data. 9 independent variables and describing 3-classes. About 100 observations in total. A 10x100 matrix of data.

I am trying to generate two discriminant functions and i think lda is the R-function I want. I have done this in SPSS using the code (is it 'S' code?)...

"DISCRIMINANT /GROUPS=group(1 3) /VARIABLES=agr min man ps con ser fin sps tc /ANALYSIS ALL /PRIORS EQUAL /STATISTICS=MEAN STDDEV UNIVF COEFF RAW COV TABLE /PLOT=COMBINED MAP /CLASSIFY=NONMISSING POOLED " In R I express this as...
library("MASS") # For lda
library("foreign")
EW <- read.spss("eurowork.sav")
Ind <- cbind(EW$AGR, EW$MIN, EW$MAN, EW$PS, EW$CON, EW$SER, EW$FIN, EW$SPS, EW$TC)
Dep <- EW$GROUP
LDA <- lda(Dep ~ Ind, prior=c(1,1,1)/3)

So far so good.

I have....

> LDA$scaling

           LD1 LD2

Ind1 1.3415788 3.689959
Ind2 1.5118460 5.215123
Ind3 1.4480197 3.653298
Ind4 2.1898063 3.875867
Ind5 1.2055849 3.913750
Ind6 0.8257858 3.718032
Ind7 1.3481728 3.699259
Ind8 1.2364320 3.871438
Ind9 2.0652630 2.891655

What do I do with this to convert it to the coefficients for the discrimination functions?

cheers
Worik



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 Received on Mon Jul 25 11:06:02 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:34:00 EST