On 21/07/2009, at 7:57 AM, Michael Knudsen wrote:
On Mon, Jul 20, 2009 at 9:37 PM, ekinakoglu<e...@ims.metu.edu.tr>
wrote:
Could you please help me with a pseudo matrix of 4x4
that is gonna work with mahalanobis?
Please speak English. ``gonna'' is not appropriate
for written communication.
Hmmm ... I have been trying some different matrices myself now, but I
keep getting the same error. Even if det(S) is very far from zero.
Maybe I just don't get the point of the mahalanobis() function in R.
It looks quite weird to me :-(
Huh?
Try:
> set.seed(42)
> X <- matrix(rnorm(100),25,4)
> S <- var(X)
> x <- rnorm(4)
> mahalanobis(x,rep(1,4),S)
[1] 6.082543
cheers,
Rolf Turner
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
______________________________________________
R-help@r-project.org 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.