Multidimensional Scaling Trigonometric Solutions on the Circle and the Sphere (MDS-T)

MDS -T

Multidimensional Scaling Trigonometric Solutions On The Circle And The Sphere (MDS-T)


Instructions

© Methodological and statistical copyright for the two-dimensional solutions (2009, 2011, 2015, 2016, 2017);
Kostas Mylonas, Department of Psychology, National and Kapodistrian University of Athens, Greece.
© Methodological and statistical copyright for the three-dimensional solutions (2017);
Sofia Papazoglou and Kostas Mylonas, Department of Psychology, National and Kapodistrian University of Athens, Greece.
© Software programming (2016);
Giorgos Santipantakis, The University of Piraeus, Greece.
The software for MDS-T was created by Giorgos Santipantakis, Ph.D., post-doctoral researcher at the University of Piraeus, with the open source Java library jReality.

The software can be downloaded and used free of charge; full reference should be included in all publications utilizing this software as follows: Santipantakis, G. (2016). Software for Multidimensional Scaling Trigonometric Solutions on the Circle and the Sphere; an extension of the Mylonas and the Papazoglou & Mylonas methods. Department of Psychology, Psychometric Laboratory, National and Kapodistrian University of Athens. Retrieved [date] from psychlabuoa.psych.uoa.gr

OVERVIEW

  1. Install the MDS-T software a
  2. Prepare the data file b , analyze the data (Proximities & ALSCAL) b, get the initial coordinates b  & save the system file for future use (use Outfile command) b . Calculate the MDS solution c  for 2 dimensions of 3 dimensions, not for both.
  3. Edit the file with the initial coordinates as copied from SPSS output and change spaces to TABS d.
  4. Get the MDS-T solution (through the MDS-T software) e  and the Cartesian coordinates (2 or 3, depending on the initial solution) e .
  5. Edit the ".out" file f  to copy the Cartesian coordinates into memory.
  6. Open the system file g  saved in (3) and replace g  the values in the DIMensions with the Cartesian coordinates calculated in (4).
  7. Run h  the syntax again using the File command and using Config(Fixed).
  8. The Kruskal's Stress value and the R2 for the constrained solution will appear in the output  .

DETAILS

aFirst create a folder named "mdsT" on the root directory of your hard disk (C:\mdsT). Download the software from psychlabuoa.psych.uoa.gr and save the unzipped file in this mdsT folder.   To do so, first save the mdsT zip file, on your desktop and then using windows explorer, cut it and move it to c:\mdsT. There you can unzip the files to be saved within that folder  .

Also, create another folder on the root directory, named "mdsTsavs", in which SPSS will save system files during the process.

 

b Prepare and analyze the research raw data file (e.g. "mock.sav"). The raw data file should include a set of variables to be analyzed so that either these variables or the cases can be multidimensionally scaled through ALSCAL.   Analyze the data through proximities and ALSCAL to get the initial MDS solution and the initial coordinates either for 2 or for 3 dimensions. The analysis should yield the coordinates along with Kruskal's Stress and R2 values. To analyze the data, select your variables and methods (e.g. create distances from data using a suitable method, standardize the data or not, select the metric level of measurement, define the number of dimensions to be calculated, and so on); make sure that from the Options menu you select "Model and options summary".   When ready, do not click "OK";  PASTE the commands so that an SPSS syntax file is created (a new syntax window with the commands will be automatically created). The ALSCAL part should look like this:

ALSCAL
  /MATRIX=IN('C:\Users\sofia\AppData\Local\Temp\spss5432\spssalsc.tmp')
  /LEVEL=ORDINAL
  /CONDITION=MATRIX
  /MODEL=EUCLID
  /CRITERIA=CONVERGE(0.001) STRESSMIN(0.005) ITER(30) CUTOFF(0) DIMENS(3,3)
  /PLOT=DEFAULT
  /PRINT=HEADER .

ERASE FILE='C:\Users\sofia\AppData\Local\Temp\spss5432\spssalsc.tmp'.

Delete the dot (.) located right after "/PRINT=HEADER" AND add the command:

/OUTFILE= 'C:\mdsTsavs\example.sav' .

So that the command lines now read:

ALSCAL
  /MATRIX=IN('C:\Users\sofia\AppData\Local\Temp\spss5432\spssalsc.tmp')
  /LEVEL=ORDINAL
  /CONDITION=MATRIX
  /MODEL=EUCLID
  /CRITERIA=CONVERGE(0.001) STRESSMIN(0.005) ITER(30) CUTOFF(0) DIMENS(3,3)
  /PLOT=DEFAULT
  /PRINT=HEADER
  /OUTFILE= 'C:\mdsTsavs\example.sav'.

ERASE FILE='C:\Users\sofia\AppData\Local\Temp\spss5432\spssalsc.tmp'.

Be very careful with the DOT (.)  Remove it from the /PRINT=HEADER  line first and then add the OUTFILE command  which should be ending with a dot (.)   Make sure you insert two blank spaces at the beginning of this line.

c Calculate the initial MDS solution. To do so, select all syntax lines, Run All.    Note down Stress, R2 and Copy all text (right-click on SPSS output-box, copy).

d   Paste memory in a word file.

-Then, select (click & drag) the coordinates part and replace all double spaces with a single space repeatedly, so that only single spaces are left in the coordinates table.   Then replace the single spaces with single TABS.  
-Add a header line beginning with #it_c (type "#it_c" which stands for #item or #case), followed by the names for the 4 columns (e.g. x, y, z   for the three unconstrained coordinates). The columns should always be 4.
From the second row onwards, each row should now contain the name/label of the item_case followed by its unconstrained 3 MDS coordinates  ( x, y, z,  separated by TABS ).   
-Use DOTS (.)  as the decimal separator;  see also the example below and “example_3d.txt” in the mdsT directory.  
-If no z coordinate is available (i.e., two-dimensional solutions), enter zeros in the fourth column (see also the file “example_2d.txt” in the mdsT directory).
-Create an input data file ( a .txt file, using notepad ) and name this file using the name of the raw data file (e.g. "mock.txt").
-Select the Word processed coordinates part and paste it in the .txt file.
-Save the .txt file on your desktop. Make sure it contains the information as specified above
-When done, copy the mock.txt  file  in  c:\mdsT  using windows explorer.

 

Mock.txt Example

#it_c    x    y    z
i1a    9.3352    2.590    0
i2b    -2.6034    5.215    0
i3a    10.043    0.825    0
i4a    3.246    1.82    0
i5b    -6.158    4.275    0
i6a    9.502    -1.013    0
i7a    -1.379    -15.447    0
i8b    -5.739    -0.635    0
i9b    -10.034    -0.247    0
i10b    -6.219    2.616    0

e  Run MDS-T software

-How to invoke the MDS-T software

Windows xp: Click the Start icon at the bottom left hand corner. Click “run” and at the prompt type cmd and press enter. At the command prompt type cd\ and press enter. Then type cd mdsT and press enter. Proceed with the next step (see Run MDS-T).

Windows 7: Change directory through windows explorer to c:\mdsT. Open a command window in the directory containing the software (press Shift and right click), as shown in the following picture

Click on the Open command window here. Proceed with the next step (see Run MDS-T).

Windows 8.1: First, open the mdsT folder from windows explorer. Left-Click on File (top left hand corner) and click on Command prompt. Within the mdsT directory proceed with the next step (see Run MDS-T).

-Run MDS-T

Windows xp, 7, and 8.1

In the command window that opens, you should now see “c:\mdsT>” Type: “run.bat” followed by the input file name of the .txt file,   e.g.   run.bat mock.txt    (also see example screenshot below):

 

Windows 10 

First, open the mdsT folder from windows explorer. Left-Click on File (top left hand corner) and click on the Powershell prompt (no need for administrator permission). Within the mdsT directory type  .\run.bat followed by the txt file to be analyzed (see also following screenshot).

 

LINUX USERS

In Linux, open a terminal in the directory of the software, and write “java -jar MDST3D.jar” followed by the name of the input file, as shown in the picture below:

-Press enter to run the program (All platforms and operating systems).

The three-dimensional MDS-T configuration is created in a window (see the following picture). This configuration can be rotated using the mouse, and one can use the menu “camera”, select the “Zoom Tool” and then use the scroll wheel of the mouse in order to zoom in the configuration.

An output file is also created by the software (in the MDST directory) with the same name as the input file and the extension .out, e.g. “example_3d.txt.out”, or "mock.txt.out". 

fOpen this output file (located in c:\mdsT) using a spreadsheet program (e.g. MS-Excel, calc-open office), delimited by tabs. The output file contains the date/time the output was created, the stimulus/item names, the unconstrained MDS coordinates x, y and z (for the first, the second and the third coordinate respectively), and the two MDS-T angles expressed in degrees, labelled “phi” for the latitude (height) and “lambda” for the longitude (xy-plane), following Hapgood (1992). The latitude angle has a range of -90 to 90 degrees and the longitude angle is expressed in the range 0 to 360 degrees. The numbers in the last three columns of the output file, labeled CartX, CartY and CartZ, are the positions of the items/stimuli on the sphere, expressed as Cartesian coordinates. Replace all dots with commas (decimal places separator) if necessary. These columns can/should be used as input through standard MDS (e.g. ALSCAL) in order to compute the goodness-of-fit indices for the constrained spherical configuration (Young’s S-stress, Kruskal’s stressR2). To do so, see g, h .

gOpen the SPSS system file created by ALSCAL (e.g, mock.sav, example.sav located in the mdsTsavs folder) and replace the values that appear in the columns labeled DIM1, DIM2, DIM3 with the values of CartX, CartY, CartZ as copied from the ".out" file MDS-T solution or CartX, CartY for the 2-dimensional solution). That is, in the system file created by ALSCAL (here, the mock.sav file), delete the values from the columns DIM1, DIM2, DIM3 and replace them with the values of CartX, CartY and CartZ. After making these changes, save this .sav file.

hReturn to the syntax window used in step (2). Change the last command as indicated.

ALSCAL
/MATRIX=IN('C:\Users\sofia\AppData\Local\Temp\spss5432\spssalsc.tmp')
/LEVEL=ORDINAL
/CONDITION=MATRIX
/MODEL=EUCLID
/CRITERIA=CONVERGE(0.001) STRESSMIN(0.005) ITER(30) CUTOFF(0) DIMENS(3,3)
/PLOT=DEFAULT
/PRINT=HEADER
/FILE= 'c:\mdsTsavs\mock.sav' CONFIG(FIXED).

ERASE FILE='C:\Users\sofia\AppData\Local\Temp\spss5432\spssalsc.tmp'.

This command is the FILE command, which reads the fixed MDS-T coordinates from the system coordinate file just created in the previous step (here, the mock.sav file). The CONFIG (FIXED) subcommand states that the algorithm should read the MDS-T coordinates as fixed.

RUN ALL SYNTAX.

In the resulting output, the Young’s S-stress, Kruskal’s stress and R2 values express the goodness-of-fit of the MDS-T solution with the data analyzed.

More information on the OUTFILE and FILE commands can be found in SPSS Help.

2-dimensional solutions

The software can also be used for MDS-T on a circle, as also mentioned previously. The difference in this case is that in the input file the column with the z-coordinates of the items is a vector of zeros (see the file “example_2d.txt”), as the stimuli have only two coordinates x and y. In the configuration created (as in the following picture) all the items/stimuli are located on the “equator”.

The “lambda” coordinates of the items (expressed in degrees) from the output file (“example_2d_txt.out” in this case) can be used in order to better understand the positions of the items on the circle, if there are many points on top of the other and the labels are not clear.

 

Link to the files Download here

 

References

Mylonas, K. (2009). Statistical analysis techniques based on Cross- Cultural research methods: cross- cultural paradigms and intra- country comparisons. Psychology, The Journal of the Hellenic Psychological Society; Special issue: Cross- Cultural Psychology, 16(2), 185- 204.

Mylonas, K., Gari, A., Panagiotopoulou, P., Georgiadi, E., Valchev, V., Papazoglou, S., & Brkich, M. (2011). Bias in Terms of Culture: Work Values country-clustering for 33 European countries and Person-Job Fit factor equivalence testing for four European countries. In J. Deutch, M. Boehnke, U. Kühnen, & K. Boehnke (Eds.), Rendering borders obsolete: Cross-cultural and cultural psychology as an interdisciplinary, multi-method endeavour. International Association for Cross-Cultural Psychology, Bremen, Germany Accessed via www.iaccp.org (download pdf)

Gari, A., Mylonas, K., & Portešová, S. (2015). An analysis of attitudes towards the gifted students with learning difficulties using two samples of Greek and Czech primary school teachers. Gifted Education International, 31(3), 271-286.

Mylonas, K. (2016). Factor structures across countries and across clusters of countries: A 36-country study on the Family Values Scale. Advances in Social Sciences Research Journal, 3(8), 63-76. DoI: 10.14738/assrj.38.2157

Mylonas, K., Lawrence, C., Zajenkowska, A., & Bower Russa, M. (2017). The Situational Triggers of Aggressive Responses scale in five countries: Factor structure and country clustering solutions. Personality and Individual Differences, 107(1), 172-179. Online first, August 2016, DoI: dx.doi.org/10.1016/j.paid.2016.07.030   

Papazoglou, S., & Mylonas, K. (2017). An examination of alternative Multidimensional scaling techniques. Educational and Psychological Measurement, 77(3), 429–448.