linear discriminant analysis in MASS
On Mon, 20 Feb 2006, Alain Paquette wrote:
Hello R people I now know how to run my discriminant analysis with the lda function in MASS: lda.alain=lda(Groupes ~ Ht.D0 + Lc.Dc + Ram + IDF, gr, CV = FALSE) and it works fine.
CV=FALSE is the default and so not needed.
But I am missing a test and cannot find any help on how to get it, if it exist. The "S" equivalent:
There is no such function in S, and I rather object as the S equivalent is lda() (and as the author of both I should know). Credit where credit is due: discrim() is an S-PLUS function, indebted to lda().
discrim(structure(.Data = Groupes ~ Ht.D0 + Lc.Dc + Ram + IDF, class = "formula"), data = gr, family = Canonical(cov.structure = "homoscedastic"), na.action = na.omit, prior = "proportional") outputs a nice matrix of Mahalanobis distances between groups and even tests (Hotelling's T Squared) for significant distances.
Well, it seems not to. That is part of the output of the summary() method, which itself calls the multicomp() method.
Why don't I just take the "S" output you say? Because like you, I'd rather put in my paper that I did it using R of course!
No `of course' applies. If you learnt of this output from S-PLUS, I urge you to credit it honestly and accurately. (If you refer to lda, you should credit that, not just R.)
Does anyone know of a way to get this test out of lda? Or of another R package that does it?
Mahalanobis distance between groups is easy, as this is just Euclidean distance between group centres in the scaled space. The test statistics can be produced, but - they are critically dependent on the unrealistic assumptions of multivariate normality and variance homogeneity and - there needs to be an adjustment for multiple comparisons.
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