| Reference | Downloads | Github

Problems with saving data (stimulus position)


I am conducting a simple experiment where I present pairs of images and ask participants to choose between them. There are two types of images. And I want to randomize their positions. So I use the shuffle function. I also need to save the data on my image positions (otherwise I will not know which image was chosen). So I make a code component on the top of my routine. Begin routine looks like that:

positions = [[-0.5, 0], [0.5, 0]]
thisExp.addData("positions", positions)

The experiment runs with no errors, images positions are randomized. But in the data xlsx file I cannot find a column with positions data. What am I doing wrong?

I tried to replace the line “thisExp.addData(“positions”, positions)”
to the End routine - but it is not working.
This data is saved in log file, however. But I need to save it in xlsx file.

Don’t use the .xlsx file output (it attempts to summarise data rather than providing the raw values you need). Use the .csv “trial-by-trial”) format instead (you can open this in Excel of course). Does it show up there?

If so, you might find it more convenient at the analysis stage if you do something like this:

thisExp.addData('position_0', positions[0][0])
thisExp.addData('position_1', positions[1][0])

to just extract the key values.

Thanks Michael, yes the csv file saved the information about stimuli positions!