Compute accuracy for each trial

PennController for IBEX Forums Support Compute accuracy for each trial

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7235
    Aymericc
    Participant

    Hello,

    We are conducting an experiment in which we display three words to the participants, and we want them to choose which of the three words belongs to another semantic category (the choice is made by clicking on the word using the ‘scale’ function).
    We are curious whether it is possible to compute the accuracy of the choice of the participants for each trial online. To do so, we already logged another column, in which we report the accurate answer for each trial. We could do this with R after collecting the data, but we would like to try doing it directly while collecting the data.
    However, we aren’t sure whether it is possible, and if so, whether you’d rather advise us to do it after collecting the data for specific reasons.

    Thank you in adveance for your answer!

    Aymeric

    #7239
    Jeremy
    Keymaster

    Hello Aymeric,

    I think what you are looking for are test commands, one of which is illustrated in the Stroop task template (line 42)

    If you need to report whether the choice was correct as an extra column for every result line of the corresponding trial, you can use a global Var element:

    Template( "table.csv" , row =>
      newTrial(
        newVar("correct").global()
        ,
        newText( row.Word ).bold().center().print()
        ,
        newText("F: word ")
            .after(newText(" J: not a word"))
            .center()
            .print()
        ,
        newKey("FJ")
            .log()
            .wait()
            .test.pressed( row.Key )
            .success( getVar("correct").set(1) ) 
            .failure( getVar("correct").set(0) )
      )
      .log( "correct" , getVar("correct") )
    )

    Sample of table.csv:

    Word,Key
    Hello,F
    Wold,J

    I don’t see any general argument for doing it one way or another, just do what’s more convenient for you

    Jeremy

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.