Re: [R] lda

From: Pieter Vermeesch <pieter.vermeesch_at_erdw.ethz.ch>
Date: Tue 17 Oct 2006 - 07:35:37 GMT

Dear Martin and Uwe,

I did indeed have a few -Inf values in my data frame. Few enough that I didn't notice them when I inspected my data.

Thanks a lot for helping me better understand the MASS *package* :-)

Pieter

On 10/17/06, Martin Maechler <maechler@stat.math.ethz.ch> wrote:
> >>>>> "Pieter" == Pieter Vermeesch <pieter.vermeesch@erdw.ethz.ch>
> >>>>> on Mon, 16 Oct 2006 19:15:59 +0200 writes:
>
> Pieter> I'm trying to do a linear discriminant analysis on a
> Pieter> dataset of three classes ("Affinities"), using the
> Pieter> MASS library:
> ^^^^^^^
> No, no! MASS *package* (please!)
>
> >> data.frame2 <- na.omit(data.frame1)
> >>
> >> data.ld = lda(AFFINITY ~ ., data.frame2, prior = c(1,1,1)/3)
>
> Pieter> Error in var(x - group.means[g, ]) : missing observations in cov/cor
>
> Pieter> What does this error message mean and how can I get rid of it?
>
> You have (+ or -) 'Inf' data values which na.omit() does not
> omit and 'x - group.means[g, ]' contains 'Inf - Inf' which is NaN.
>
> Ideally, MASS:::lda.default() would check for such a case and
> give a more user-friendly error message.
>
> Pieter> Thanks!
>
> you're welcome.
> Martin Maechler, ETH Zurich
>

-- 
Pieter Vermeesch
ETH Zürich, Isotope Geology and Mineral Resources
Clausiusstrasse 25, NW C 85, CH-8092 Zurich, Switzerland
email: pvermees@erdw.ethz.ch, tel: +41 44 632 4643

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.
Received on Tue Oct 17 17:46:41 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 17 Oct 2006 - 08:30:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.