Na.Ebrahimi
2010-Sep-17 15:08 UTC
[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]]
Ravi Varadhan
2010-Sep-17 18:29 UTC
[R] How to find STRESS criteria in MDS when there are negative eigenvalues....
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.