[R] how to reduce stress value in isoMDS?

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Sep 3 09:24:10 CEST 2008


There is still no call to isoMDS in your code, and nothing we can 
reproduce.

It all depends on the dissimilarity matrix you have not given us: maybe 
there is no good 2D representation of it.

Looks like you need to ask a local expert about what you are doing, for 
this is a statistical and not an R question.


On Wed, 3 Sep 2008, 陈武 wrote:

> Sorry, wrong code. The right one here:
>
> library(MASS)
> cl<-read.table("e:/data.txt",header=T,sep=",")
> row.names(cl)<-colnames(cl)
> cm<-as.matrix(cl)
> loc<-sammon(cm)
> jpeg(filename="e:/plot.gif",width = 480, height = 480, units = "px",
> pointsize = 12, quality = 75, bg = "white", res = NA, restoreConsole = TRUE)
> plot(loc$points,type="p")
> text(loc$points,rownames(cl),cex=1,pos=1,offset=1)
> dev.off()
>
> And "e:/data.txt" contains a 40*40 dissimilarity matrix. Thanks for you
> advices!
>
>
> 2008/9/3, ???? <geminiwhu at gmail.com>:
>>
>> I apply isoMDS to my data, but the result turns out to be bad as the stress
>> value stays around 31! Yeah, 31 ,not 3.1... I don't know if I ignore
>> something before recall isoMDS.
>> My code as follow:
>>
>> m <- read.table("e:/tsdata.txt",header=T,sep=",")
>> article_number <- ts(m, start = 2004,end=2008, frequency = 1
>> ,names=colnames(m))
>> jpeg(filename="e:/tsmap.gif",width = 480, height = 480, units = "px",
>> pointsize = 12, quality = 75, bg = "white", res = NA, restoreConsole = TRUE)
>> plot(article_number, plot.type="single",
>> lty=c(1,1,1,1,1),col=c(1,2,3,4,5),las=1)
>> max<-range(m)
>> x<-c(2004,2004,2004,2004,2004)
>>
>> y<-c(max[2]*0.96,max[2]*0.9199999999999999,max[2]*0.88,max[2]*0.84,max[2]*0.7999999999999999)
>> points(x,y,col=c(1,2,3,4,5),pch=15)
>> text(x,y,colnames(m),pos=4,offset=0.4)
>> dev.off()
>>
>> A 40*40 matrix in "e:/tsdata.txt". How should I do to improve the effect?
>> Thank you!
>>
>
> 	[[alternative HTML version deleted]]

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


More information about the R-help mailing list