Skip to content

MDS with ranking data (and transformation)

3 messages · Charles C. Berry, achristoffersen

#
Dear Sirs and madams :-)

I am trying to teach myself multidimensional scaling. To that effect I have
collected a survey asking people to rank 10 philosophers and politicians
according to their preference. I have collected 61 answers. The data is
organized in ten columns and 61 rows. the columns are "choice_1",
"choice_2", "choice_3" etc. The cells is the name of the philosopher

I guess I need to put the data in some other format, e.g. with colloumns:
"philospher_1", "philospher_2", "philospher_3" etc. and then have the cell
hold the particular ranking (score) for that philospher (i.e. a number
between 1:10)

I guess such a transformation would also allow me to do clusteranalysis? -
But how to do it???

Anyways: what I have done so far is to compute a 10*10 matrix in a
spreadsheet application. I do this by
countif(range_choice1=philospher1)*10 for each philospher.
In ?range_choice2? I multiply by 9, and in ?range_choice3? I multiply with 8
etc.

The corresponding matrix I import to r and do 
dist(t(matrix)
and then I use cmdscale$points to draw a plot. It looks nice but I am almost
sure I'm doing it wrong. And I would certainly like not having rely on a
spreadsheet.

So my question is: how to transform the data, and is it true that my current
'spreadsheet' method is wrong? Also: should consider discarting some data,
e.g. only using the top 3 choices?

Cheers in advance.

Andreas
#
On Sun, 15 Feb 2009, achristoffersen wrote:

            
Something like

dat <- t( apply( your.data, 1 , order ) )
colnames(dat) <- paste( 'philosopher', 1:10, sep='_' )

HTH,

Chuck
Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901
#
Charles C. Berry wrote:
Hi Chuck - thx - but I have trouble geting further. I think I need "rank"
not "sort" - but this still doesnet solve my conundrum.

I have data like this
v1,v2,v3
nameA,nameB,nameC
nameB,nameA,nameC
nameB,nameA,nameC
nameA,nameC,nameB

And I would like to transform to this
nameA,nameB,nameC
v1,v2,v3,
v2,v1,v3
v2,v1,v3
v1,v3,v2

Hope this makes sense?

Thx again!
Andreas