[R] Mahalanobis distances

From: Karen Kotschy <karen_at_biology.biol.wits.ac.za>
Date: Sat 25 Jun 2005 - 00:22:13 EST


Dear R community

Have just recently got back into R after a long break and have been amazed at how much it has grown, and how active the list is! Thank you so much to all those who contribute to this amazing project.

My question:
I am trying to calculate Mahalanobis distances for a matrix called "fgmatrix"

>dim(fgmatrix)

[1] 76 15

>fg.cov <- cov.wt(fgmatrix)
>mahalanobis(fgmatrix, center = fg.cov$center, cov = fg.cov$cov)

Then I get an error message "Covariance matrix is apparently singular"

What does this mean? I can't see anything strange about the covariance matrix, and am not getting anywhere with the help files.

>dim(fg.cov$cov)

[1] 15 15
>length(fg.cov$center)

[1] 15

Thanks

-- 
Karen Kotschy
Centre for Water in the Environment
University of the Witwatersrand
Johannesburg
South Africa

P/Bag X3, Wits, 2050
Tel: +2711 717-6425

______________________________________________
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 Fri Jun 24 23:04:35 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:02 EST