[R] lda: scaling to 'disctiminant function'

Worik Turei stanton turwa720 at student.otago.ac.nz
Mon Jul 25 03:03:06 CEST 2005


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




More information about the R-help mailing list