Script Syntax to Create Proximity Matrix

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Script Syntax to Create Proximity Matrix

Caroline Davis-2
Hello list!

I have an issue that perhaps someone may be able to help with? I have a 51 (participants)x15(excerpts) matrix with content referring to the pile number the excerpt was placed in (e.g. a 4 in row 1, column 1 means that participant 1 put excerpt 1 in pile 4).  I am currently trying to transform the data into a proximity matrix so that I can run an MDS calculation.  Does anyone know how to manipulate the script syntax in order to accomplish this? I'm not familiar with writing scripts in SPSS, so I'm looking for an explanation that corresponds to my dataset/problem.

I have read through the resolution (16651) on the SPSS help backlog, but I have received several errors when I try to input the script.  

Any thoughts would be much appreciated.  
Thanks!
Caroline
Reply | Threaded
Open this post in threaded view
|

Re: Script Syntax to Create Proximity Matrix

Spousta Jan
Hi Caroline,
 
try this syntax:

 

* Prepare fake data (you will load your data here using GET FILE or similar).

INPUT PROGRAM.

VECTOR excerpt (15).

LOOP #i = 1 to 51.

- LOOP #j = 1 to 15.

- COMPUTE excerpt(#j) = trunc(uniform(10)+1).

- END LOOP.

- END CASE.

END LOOP .

END FILE.

END INPUT PROGRAM.

EXECUTE.

FORM all (f2).

* compute the matrix (change the syntax as needed - look in the manual for PROXIMITIES procedure).

PROXIMITIES excerpt1 to excerpt15

/VIEW=CASE

/MEASURE= CHISQ

/STANDARDIZE= NONE

/MATRIX OUT("C:/TEMP/mydistances.sav").

 

Best regards,
 
Jan
 
 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Caroline Davis
Sent: Thursday, February 05, 2009 11:56 PM
To: [hidden email]
Subject: Script Syntax to Create Proximity Matrix

Hello list!

I have an issue that perhaps someone may be able to help with? I have a 51 (participants)x15(excerpts) matrix with content referring to the pile number the excerpt was placed in (e.g. a 4 in row 1, column 1 means that participant 1 put excerpt 1 in pile 4).  I am currently trying to transform the data into a proximity matrix so that I can run an MDS calculation.  Does anyone know how to manipulate the script syntax in order to accomplish this? I'm not familiar with writing scripts in SPSS, so I'm looking for an explanation that corresponds to my dataset/problem.

I have read through the resolution (16651) on the SPSS help backlog, but I have received several errors when I try to input the script.  

Any thoughts would be much appreciated.  
Thanks!
Caroline
 

_____________

Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Jestliže jste tento mail dostali neoprávněně, prosím, uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto přenosem.

P Jste si jisti, že opravdu potřebujete vytisknout tuto zprávu a/nebo její přílohy? Myslete na přírodu.

 


This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the message as well as all attached documents. The sender does not accept liability for any errors or omissions as a result of the transmission.

 

P Are you sure that you really need a print version of this message and/or its attachments? Think about nature.

-.- --
Reply | Threaded
Open this post in threaded view
|

Re: Script Syntax to Create Proximity Matrix

alexwin
In reply to this post by Caroline Davis-2
Dear Caroline,

I use the following trick to get proximity matrix from sort data -- see example below:

data list free / expert obj01 to obj06 (7F8).
begin data.
1 1 1 2 2 3 3
2 1 1 1 2 2 2
3 2 2 1 1 1 3
end data.

variable labels
  obj01 'object 1'
  obj02 'object 2'
  obj03 'object 3'
  obj04 'object 4'
  obj05 'object 5'
  obj06 'object 6'.

split file by expert.

PROXIMITIES obj01 to obj06
  /VIEW=VARIABLE
  /MEASURE= BLOCK
  /MATRIX= OUT('c:\mtx.sav').

get file = 'c:\mtx.sav'.

recode obj01 to obj06 (0=1) (else=0).

AGGREGATE
  /OUTFILE='C:\aggregated.sav'
  /BREAK=ROWTYPE_ VARNAME_
  /obj01 = SUM(obj01)
  /obj02 = SUM(obj02)
  /obj03 = SUM(obj03)
  /obj04 = SUM(obj04)
  /obj05 = SUM(obj05)
  /obj06 = SUM(obj06).

get file = 'c:\aggregated.sav'.

value labels ROWTYPE_ 'PROX' 'SIMILARITY'.

HTH,

Dr. Alexander Vinogradov, Associate Professor
Sociology and Psychology Faculty
National Taras Shevchenko University
Ukraine

>
Hello list!

I have an issue that perhaps someone may be able to help with? I have a 51 (participants)x15(excerpts) matrix with content referring to the pile number the excerpt was placed in (e.g. a 4 in row 1, column 1 means that participant 1 put excerpt 1 in pile 4).  I am currently trying to transform the data into a proximity matrix so that I can run an MDS calculation.  Does anyone know how to manipulate the script syntax in order to accomplish this? I'm not familiar with writing scripts in SPSS, so I'm looking for an explanation that corresponds to my dataset/problem.

I have read through the resolution (16651) on the SPSS help backlog, but I have received several errors when I try to input the script.

Any thoughts would be much appreciated.
Thanks!
Caroline




=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD