0

I) PROBLEM

Let’s say I have a matrix like this with distances (in kilometers) between the homes of different people.

|          | Person 1 | Person 2 | Person 3 |
|----------|----------|----------|----------|
| Person 1 |          |          |          |
| Person 2 | 24       |          |          |
| Person 3 | 17       | 153      |          |

And I have a data table like this:

| Person   | Party    |
|----------|----------|
| Person 1 | Party A  |
| Person 2 | Party B  |
| Person 3 | Party C  |

I want to do multidimensional scaling (dissimilarity by distance) to visualize i) how close each person lives to another; ii) which party each person votes for (different colors for each party)

II) CURRENT RESULT

My current plot of MDS (made with SPSS) is like this (I don’t use a code line, but a menu commands in SPSS). :

MDS plot without colors

III) EXPECTED RESULT

I want to add a different color for each person depending on which party this person votes for:

MDS plot with colors

IV) QUESTION(S)

Can I do it in SPSS? How to add the data about votes in the matrix and how to show it in MDS plot?

EDIT There is quite the same problem and solution for R. R) Create double-labeled MDS plot But I want to do it in SPSS.

ag_1812
  • 158
  • 2
  • 10
  • 1
    You can certainly show scatter plots using different colours in Stata. Otherwise a problem is with this is the lack of code used so far and a reproducible example. – Nick Cox Mar 18 '19 at 13:04
  • A serious detail with your example is that red and green are hard for many people to tell apart. – Nick Cox Mar 18 '19 at 13:04
  • Thanks for your comments. I don’t use a code line, but menu in SPSS. – ag_1812 Mar 18 '19 at 13:12
  • OK. Sorry, I’m a newbie in statistical software. So now it’s only about SPSS. – ag_1812 Mar 18 '19 at 13:23
  • I'd ask on an SPSS forum, presuming that there is one or more (sorry, I have no information on that). – Nick Cox Mar 18 '19 at 13:35

1 Answers1

1

I don't believe it's possible to create a plot like the one you show directly from either of the MDS procedures currently available in SPSS Statistics, PROXSCAL or ALSCAL. I think what you'd need to do would be to save the common space coordinates to a new dataset or file, then add the Party variable to that new dataset or file, define it as Nominal in the measurement level designation in the Data Editor, and then use the Grouped Scatter option under Scatter/Dot in the chart Gallery in the Chart Builder, defining groups by the Party variable.

The PROXSCAL procedure lets you save things from the dialogs in the Output sub-dialog. The ALSCAL procedure only supports saving out of common space coordinates and other things using command syntax, specifically using the OUTFILE subcommand (you can paste the command from the dialogs, then add this subcommand).

David Nichols
  • 576
  • 3
  • 5
  • Thank you for your answer. I keep the workflow you proposed for later tests. For now, I solved my problem by using R. So I mark this question as answered. Thanks again. – ag_1812 Nov 15 '19 at 20:27