import file superlab in spss

Hi, I鈥檇 like to know how to import a superlab output file in spss :confused:. The superlab output file provides a tab in which on the raws you have the stimula and on the columns you have several indicators (e.g. reaction time).

I need to have on the raw all the reaction times of a single subject. Can someone help me please :D?

Use the free DataViewer to transpose output for SPSS

If I understand correctly, then you would like to take a data file that looks like this:

[SIZE=3]P_Name[/SIZE]路路路路路路路路路[SIZE=3]P_Group[/SIZE]路路路路路路路路路[SIZE=3]R_Time[/SIZE]
John
路路路路路路路路路路路路First路路路路路路路路路路路路123
Mike
路路路路路路路路路路路路Third路路路路路路路路路路路路456
Sara
路路路路路路路路路路路路Third路路路路路路路路路路路路339

and turn it into a data file that looks like this:

[SIZE=3]P_Name[/SIZE]路路路路路路路路路路路路John路路路路路路路路路路路路Mike路路路路路路路路路路路路Sara
[SIZE=3]P_Group[/SIZE]
路路路路路路路路路路路路First路路路路路路路路路路路路Third路路路路路路路路路路路路Third
[SIZE=3]R_Time[/SIZE]
路路路路路路路路路路路路123路路路路路路路路路路路路456路路路路路路路路路路路路339

Is that correct?

If so, then here are the steps that will allow you to achieve that goal:

[SIZE=鈥4鈥漖鈥淣ew Instructions鈥 (for DataViewer 2.0):[/SIZE]

  1. Get the free download of DataViewer 2.0 (Mac version or Windows version) from the following web page:

http://community.cedrus.com/showthread.php?t=571

or

http://www.superlab.com/dataviewer

  1. Open your output file(s) in the DataViewer.

  2. Click 鈥淢erge Selected Files鈥︹ (Or, alternatively, you may select 鈥淔ile >> Merge Selected Files鈥 from the main menu bar of the application).

  3. A dialog window will pop up with the title 鈥淢erge Options.鈥

  4. Put a checkmark in the box for the option 鈥淭ranspose rows and columns in the merged file.鈥

  5. Now click 鈥淢erge鈥︹ on the pop up dialog.

  6. You will be given a chance to specify where the transposed output will be saved. Specify where to save the output and then click 鈥淪ave.鈥

[SIZE=鈥4鈥漖鈥淥ld Instructions鈥 (for DataViewer 1.0):[/SIZE]

  1. Get the free download of DataViewer 1.0 (Mac version or Windows version) from the following web page:

http://community.cedrus.com/showthread.php?t=273

  1. Open your output file in the DataViewer.

  2. From the main menu of the DataViewer application, go to 鈥淒ata >> Transpose Output.鈥 You should then see in the status bar the message 鈥淒ata will be transposed in merged output file.鈥

  3. Now click 鈥淢erge Selected Files.鈥 The file that you save will contain your data in the 鈥渟ideways,鈥 transposed layout that you are seeking.

Thanks so much for your reply but unfortunately I still have problems.
I need to have for each participant on the same raw his/her reaction time for each stimulus and the key (X or N) participants pressed for each stimulus presented but I can鈥檛 do it. I鈥檝e tried lots of efforts but without any results. I really hope I don鈥檛 have to insert all the keys manually. Could you help me if I send you the output? Thanks so much!

by default, the reaction time would be on the same row as the key pressed.

It would help to see an example of your input and an example of how you would like to see the input organized.

I鈥檓 sending an excel file where there are two examples:
firstly an example of how the output appears and secondly an example of how we would like the output appeared. Thanks so much!!

output.txt (1.29 KB)

It seems to me that what you need is the use of Pivot Tables.

http://en.wikipedia.org/wiki/Pivot_table

According to what I just read on wikipedia, OpenOffice.org Calc apparently provides this type of functionality. OpenOffice Calc is a free download from Sun Microsystems.

It is tricky to get pivot tables working correctly. I am not familiar with the availability or the quality of any OpenOffice documentation on the subject.

shell script

This kind of data manipulation is pretty easy using unix-style command line tools. The following uses some utilities that you probably won鈥檛 have easy access to, but perhaps it would be worthwhile as a general example. I copied your example datafile into the paste buffer, and then ran this command:

pbpaste | tab2dm | tail +7 | dm s2 s5 s11 s5 s10 | scrunch -u 4 | tr "_ " " "

It produced: subject 1 stimulus1 (15, paura) 3749 stimulus1 (15, paura) C subject 1 stimulus1 (10, loculo) 4221 stimulus1 (10, loculo) C subject 1 stimulus1 (6, rocatrice) 4203 stimulus1 (6, rocatrice) subject 1 stimulus1 (27, prontesso) 4032 stimulus1 (27, prontesso) C

pbpaste: write contents of paste buffer standard output. normally, you wouldn鈥檛 do this, you鈥檇 read from a file instead.

tab2dm: program I wrote to convert spaces to underscores and tabs to spaces (this format is much easier to script than the tab-delimited format with internal space characters in the SL datafile). reads from standard input, writes to standard output

tail +7: skip the first 6 lines from standard input and copy the rest to standard output

dm s2 s5 s11 s5 s10: select certain space-delimited columns from standard input and write them to standard output. this is an utillity called Data Manipulator written by Gary Perlman as part of the old UNIX|Stat package. The column numbers correspond to the columns in the SL datafile that you wanted

scrunch -u 4: a utility I wrote to join successive lines from standard input together to standard output, in this case, four lines without repetitions

tr "_ " " ": put back the spaces and tabs (if there were any underscores in the orginal file, this will turn them incorrectly into spaces). personally, I鈥檇 omit this step and stay with the underscores.

There are plenty of other ways to do the equivalent and to extend it as needed with fairly simple scripts.

Greg Shenaut

Greg,

Instead of going through the effort of writing tab2dm, you could have also inserted the following:

sed 鈥榮/ /_/g鈥 | sed 鈥榮/ / /g鈥

that would be:

sed: swap space with underscore globally

sed: swap tab with space globally

I just thought you might like to know. Behold the power of sed. :slight_smile:

http://en.wikipedia.org/wiki/Sed

Thanks very much for your reply!
I don鈥檛 know how to use unix-style command line tools. It鈥's very difficult to understand it. I don鈥檛 know the programming language and this seems to be a big problem if I want to follow your suggestions. Could you help me again and suggest me something easier? Thanks a lot!

Hank, yes, of course sed can be used. The tab2dm program also has a couple other bells and whistles (it can skip lines at the beginning and also sticks an underscore into 鈥渆mpty鈥 columns so the column numbering doesn鈥檛 get messed up for programs that want 鈥渟pace-delimited鈥 lines of input. I used to use various combinations of sed, tail, and tr for this kind of thing, but once I started using SL to gather data, I decided that that was too much pain so I wrote tab2dm. I鈥檝e attached it here as a .txt file.

SInce we鈥檙e on this subject, I鈥檓 also attaching a Korn shell script I wrote for a recent experiment that uses tab2dm. I think it鈥檚 illustrative of the kinds of techniques and kludges that are needed for this kind of thing with real data. This was data from a lexical decision, semantic priming experiment with three kinds of prime-target relations. There were 10 SOAs and 40 subjects were run at each one (whew!). It was the first real experiment we completed with SL. The script is 鈥済ood enough鈥 for present purposes, but one of the not-satisfactory parts was selecting a given SL datafile column. In the cvtsl4 script, I did this by inspecting the actual datafiles and using column numbers.

Next time, I鈥檒l probably use something like the third script I鈥檝e attached (sl4hdr), which uses the column labels in lines 5 and 6 to assign the column numbers to variables, and also copies the subject ID, scenario name, and the run data and time into variables for later use. I wrote this script as a sort of 鈥減roof of concept鈥, I鈥檝e never actually used it on anything.

This is probably way too much detail, but maybe it will inspire someone.

Greg

tab2dm.c.txt (556 Bytes)

cvtsl4.ksh.txt (2.82 KB)

sl4hdr.ksh.txt (1.69 KB)

giuspac, I apologize for not having a scriptless solution for you. You could use a spreadsheet instead of the command line, but I think you鈥檇 still have to write some kind of script involving spreadsheet expressions or visual basic.

Greg