Skip to content
Back to formatted view

Raw Message

Message-ID: <1daa4e8d0901200119x51289104s84b5757e40bfde69@mail.gmail.com>
Date: 2009-01-20T09:19:01Z
From: Iuri Gavronski
Subject: Converting rankings to paired-comparisons

Hi,

I need to convert a ranking dataset (actually, it is an ipsative
scale) to paired-comparisons.

For example, if I have this data:
x <- matrix(c(10,20,30,40,0,
    10,10,10,10,50,
    30,30,30,5,5), nrow=3, ncol=5, byrow=TRUE,
    dimnames = list(1:3, letters[1:5])
)

For every pair of data, I would need to apply a transformation like:

if a < b, ab = 0, otherwise ab=1

In the end, I need a matrix like that:

ab ac ad ae bc bd be cd ce de
0  0  0  1  0  0  1  0  1  1
1  1  1  0  1  1  0  1  0  0
1  1  1  1  1  1  1  1  1  1

Would anyone suggest a "no loops" way for doing that?

By the way, I would need to apply a tetrachoric correlation to this
output matrix. Should I use package polycor? Any thoughts would be
welcome.

Thanks,

Iuri.