[R] Analyzing dissimilarity ratings with Multidimensional Scaling

Mike Marchywka marchywka at hotmail.com
Tue Feb 15 01:10:20 CET 2011







________________________________
> Date: Tue, 15 Feb 2011 00:53:46 +0100
> Subject: Re: [R] Analyzing dissimilarity ratings with Multidimensional
> Scaling
> From: turchet.luca at gmail.com
> To: marchywka at hotmail.com
> CC: r-help at r-project.org
>
> Hi Mike and all,
> thanks again. Actually your suggestion is a good way to print data in
> R, but unfortunately
> does not add any information to what I aready have on my table data.
>
> What I would like to see is how far are the trials from each others in
> terms of
> similarity.
>
> ...maybe I just need another way to analyze the data. For this reason I ask
> if someone has other suggestions, maybe coming back to the MDS?
>
> Is there anyone who can provide an R example about how I can analyze my data
> with a MDS analysis?


Well, if you type that into google you get a lot of hits. 

This is one, 

http://www.personality-project.org/R/mds.html

but it starts with a distance matrix and the is just one line,

?cmdscale

if you use that other set of code I sent with the euclidian distance
from daisy,

> lx<-cmdscale(dasm,k=2)
> plot(lx)
> str(lx)
 num [1:6, 1:2] 4.98 5.7 -3.23 -2.35 -2.76 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:6] "1" "2" "3" "4" ...
  ..$ : NULL
> lx
       [,1]        [,2]
1  4.977983 -0.05752524
2  5.695654  0.21934024
3 -3.227248  2.03991177
4 -2.354248  0.01878125
5 -2.762453 -1.13571894
6 -2.329688 -1.08478908
>






>
>
> Luca
>
>
>
> On Mon, Feb 14, 2011 at 6:40 PM, Mike Marchywka
> > wrote:
>
>
>
>
>
>
>
>
>
>
>
> ________________________________
> > Date: Mon, 14 Feb 2011 17:55:50 +0100
> > Subject: Re: [R] Analyzing dissimilarity ratings with Multidimensional
> > Scaling
> > From: turchet.luca at gmail.com
> > To: marchywka at hotmail.com
> > CC: r-help at r-project.org
> >
> > Dear Mike,
> > thanks a lot for your answer. Unfortunately the way you kindly
> > suggested is not suitable
> > to solve my problem.
> >
> > Indeed as said, I need to display the distances between the proposed
> trials,
> > for example I would like to see a 2D plot where I can see how fare is the
> > trial MT-MT from the trial MT-SW (that is how far are the evaluations
> of the
> > audio-visual trial with metal-metal from the trial with metal-snow)
>
> I thought the dendrogram is what you wanted but apparently you can just
> use daisy perhaps. This had a lot of typos and may not run as last example
> I sent had bad edits but this does create scatterplot with zero points on
> diagonal etc. Presumably you can define your own functions appropriate for
> your data ( I've never used some of this before which is why I'm trying,
> cavear emptor).
>
> library("cluster")
> ddm<-daisy(matrix(xm,6,6),metric="euclidean")
> str(ddm)
> library("scatterplot3d")
> dasm<-as.matrix(ddm);
> nddf<-reshape(data.frame(dasm),varying=c("X1","X2","X3","X4","X5","X6"),v.name="time",
> direction="long")
> str(nddf)
> ij<-as.numeric(gl(6,6))
> n2<-cbind(nddf,ij)
> str(n2)
> scatterplot3d(n2$ij,n2$id,n2$time,type="h")
>
>
>
>
> >
> > Does anyone have any other suggestion to build such perceptual map in R?
> >
> > In addition, how can I get some information regarding the significant
> > differences
> > between the trials?
> > If I used the ANOVA would be simple to get those p-values. I wonder if
> > it is the
> > case to use it...
> >
> > Help!
> >
> >
> > Luca
> >
> >
> >
> >
> > On Mon, Feb 14, 2011 at 3:23 PM, Mike Marchywka
> > > wrote:
> >
> >
> >
> > > My first goal in the analysis process is to print a perceptual map
> where to
> > > place the pairs of
> > > audio-visual stimuli (e.g. WD-WD, MT-DL, etc.) and see how far the trials
> > > are from each other.
> >
> > I've been using heatmap for stuff like this.
> > You can get a nice picture this way and get quick visual
> > survey and dendrograms,
> >
> > xm<-scan(file="avm.txt")
> > str(xm)
> > heatmap(xm)
> > heatmap(matrix(xm,6,6))
> >
> > I ran the above on your data and it visually looks
> > like there could be interesting patterns to test.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > ---------------------------------------------------------------
> >
> > "Music is a moral law:
> > It gives a soul to the Universe,
> > wings to the mind,
> > flight to the imagination,
> > a charm to sadness,
> > and life to everything.
> > It is the essence of order,
> > and leads to all that is good,
> > just and beautiful,
> > of which it is the invisible,
> > but nevertheless dazzling,
> > passionate, and eternal form".
> >
> > Plato, 400 B.C. (from the Dialogues)
> >
>
>
>
>
> --
> ---------------------------------------------------------------
>
> "Music is a moral law:
> It gives a soul to the Universe,
> wings to the mind,
> flight to the imagination,
> a charm to sadness,
> and life to everything.
> It is the essence of order,
> and leads to all that is good,
> just and beautiful,
> of which it is the invisible,
> but nevertheless dazzling,
> passionate, and eternal form".
>
> Plato, 400 B.C. (from the Dialogues)
>
 		 	   		  


More information about the R-help mailing list