[R] How to find STRESS criteria in MDS when there are negative eigenvalues....

Ravi Varadhan rvaradhan at jhmi.edu
Fri Sep 17 20:29:13 CEST 2010


Perhaps, the "smacof" package on CRAN might be useful to you.

Ravi.

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Na.Ebrahimi
Sent: Friday, September 17, 2010 11:08 AM
To: r-help at r-project.org
Subject: [R] How to find STRESS criteria in MDS when there are negative
eigenvalues....

Hi,
I want to know whether there is any function in R to find STRESS after using
cmdscale and estimating the coordinates, I have written these functions to
find stress (for p =1,2,3,4,5)
 
stress<-rep(0,5)
for(p in 1:5)
{
datahat<-cmdscale(d,p)
deltahat<-as.matrix(dist(datahat))
a<-0
b<-0
for(i in 1:n)
{
for(j in 1:n)
{
a<-d[i,j]^2+a
b<-(d[i,j]-deltahat[i,j])^2+b
}
}
stress[p]<-b/a
} 
stress<-sqrt(stress)
stress
 but it seems that it is not true when there are negative eigenvalues in
dissimilarity matrix could you please help me to find the answer
thank you in anticipation

	[[alternative HTML version deleted]]

______________________________________________
R-help at 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.



More information about the R-help mailing list