**Date:** Mon, 19 Sep 2005 13:46:43 -0400
**Reply-To:** Paul Egli <paul.egli@tns-global.com>
**Sender:** "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
**From:** Paul Egli <paul.egli@tns-global.com>
**Subject:** Transforming vector data into matrix format
Hello all,

I have a fairly complex (at least I think it is complex anyway) data
transformation procedure I am trying to run in SPSS. I have a data set of
10 variables where each vector represents the ranking of those concepts by
one individual. To be specific the data looks like this:

ID v1 v2 v3 v4 v5 v6
v7 v8 v9 v10
1 2 3 7 8 10 1
4 5 6 9
2 10 2 1 3 4 5
6 7 9 8
3 9 6 4 2 1 3
5 7 10 8
.
.
.
1000 2 4 8 10 9 3 5
7 1 6

What I would like to do is to create some syntax or a macro that will
change this data into a matrix where everything in columns above the
diagonal is the number of times each concept was ranked higher than the
corresponding row concept and everything in columns below the diagonal is
the number of times each concept was ranked lower than the row concept. The
diagonals themselves will be equal to N/2 but right now I am more concerned
with the off diagonals.

I believe this can be done with the matrix language but in all my years of
dealing with SPSS I haven't had the "pleasure" of working with any matrix
commands and the help text is a misnomer in this regard. I'm sure there are
macros that could do this as well but I haven't found anything on Raynard's
page or other links that have been very useful as references.

If anyone has any ideas how this can be done or knows of a reference I can
check into I would greatly appreciate it.

Also, I believe this is the first step in converting the rank data in
interval scaled data via a Thurstone Case V transformation... if anyone has
any code to do this that would even be more helpful.

Thanks in advance.

Paul