Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

log all variables in x columns but in one row

Hello

I have the following problem: I want to write all captured variables from 2 loops (the first loop has a random order with 96 rows) into a logfile, but in only one row with x columns. It doesn't seem to work with the logger, which is why I already worked with a python inline_script. However, it doesn't write the variables the way I would like it to. Can someone help me with an example code?

Comments

  • edited October 25

    Hi Mirko,

    Having only one row strikes me as unusual data format. But assuming that's really want to do, then the trick would be to:

    • Make sure that all variables that you want to log have a unique name so that they end up in different columns, and;
    • Run the logger only once, after the second loop.

    Cheers!

    Sebastiaan

  • edited November 8

    Hi Sebastiaan,

    please excuse my late reply. I'm already on further experiments. So again briefly explained why I want to have all variables of a run in a row. 

    If I had several test persons perform the test, I have to merge the data sets. This means that I first have to sort the random order and then merge all datasets. These are again several steps that you could save yourself if you could write the data of a run directly into one line. But maybe I see it wrong.

    I try to put my experiment online so that you can have a look at it. Maybe what I mean will open up. 

  • Hello, Sebastiaan,


    please excuse my late reply. I'm already on further experiments. So again briefly explained why I want to have all variables of a run in a row. 


    If I had several test persons perform the test, I have to merge the data sets. This means that I first have to sort the random order and then merge all datasets. These are again several steps that you could save yourself if you could write the data of a run directly into one line. But maybe I see it wrong.


    I try to put my experiment online so that you can have a look at it. Maybe what I mean will open up. 

    Edit: request failed 400 🙄

  • Hi,

    If I had several test persons perform the test, I have to merge the data sets. This means that I first have to sort the random order and then merge all datasets

    I am not sure I get the motivation behind this. If you have multiple participants having done the same experiment, the datasets should have the same form, i.e. columns. The specific order shouldn't matter if you merge the files. Most software combines data sets by column name and not column order. Or do I misunderstand you?

    Eduard

  • Hi Eduard,

    here you can see a screenshot of my logfile:

    1. colums = random loop number

    screenshot from the loop:


    1. column = right or wrong
    2. column = pressed key
    3. column = reaction time

    After the data you can see in the log file, some questionairs are following and the variables are written in the first column.

    My problem is, to sort all in order to work with spss or R.

    Hope my explanation is good to understand.

    Thanks for the help.


    Mirko

  • Hi Mirko,

    Did you handpick the variables that the logfile should include? If so, you also have to add the subject number, block number and other identifying variables. If you don't have them, you won't be able to merge the datafiles into a single file and analyse it properly. Aside of that, it is also confusing why you don't have the variable names in the first column. Did you skip the first row when importing the data?


    Eduard

Sign In or Register to comment.