[R] discriminant analysis

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon May 24 08:28:27 CEST 2004


On Mon, 24 May 2004, Stefanie von Felten wrote:

> I have done different discriminant function analysis of multivariat

Using lda in contributed package MASS, uncredited.

> data. With the CV=True option I was not able to perform the predict()
> call. What do I have to do? Or is there no possibility at all? You also

It makes no sense.  You ask for LOO cross-validation, and that is n 
separate fits, not a single fit from which you can predict.

> need the predicted values to produce a plot of the analysis, as far as I
> know.
> 
> Here my code:
> 
> pcor.lda2<-lda(pcor~habarea+hcom+isol+flowcov+herbh+inclin+windprot+shrubcov+baregr, data=pcor.df, CV=T)
> table2<-table(pcor.df$pcor, pcor.lda2$class)
> table2
> 
> #doesn't work, becoause CV=True?
> pcor.ld2<-predict(pcor.lda2, dimen=1)$x
> plot(pcor.ld2)
> plot(pcor.lda2, type="density", dimen=1) #kernel density estimates 
> 
> I am happy if I get an answer from somebody!

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list