Latency for multiple responses in one trial


Author
Message
nidhi_desai
nidhi_desai
Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)
Group: Forum Members
Posts: 20, Visits: 133
How can I save the response time between each response when the participant can respond multiple times during one trial?
Dave
Dave
Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)
Group: Administrators
Posts: 11K, Visits: 65K
nidhi_desai - 1/26/2021
How can I save the response time between each response when the participant can respond multiple times during one trial?


<block myblock>
/ trials = [1=mytrial]
</block>

<values>
/ n_responses = 0
/ rt = 0
/ prev_rt = 0
/ diff_rt = 0
</values>

<trial mytrial>
/ ontrialbegin = [
    values.n_responses = 0;
    values.rt = 0;
    values.prev_rt = 0;
    values.diff_rt = 0;
]
/ stop = [
  trial.mytrial.elapsedtime >= 10000;
]
/ stimulustimes = [0=clearscreen,mytext]
/ validresponse = ("E", "I")
/ isvalidresponse = [
    if (trial.mytrial.responsetext == "E" || trial.mytrial.responsetext == "I"){
        values.n_responses += 1;
        values.rt = trial.mytrial.latency;
        values.diff_rt = values.rt - values.prev_rt;
        values.prev_rt = values.rt;
        true;
    }
]
/ responsemessage = ("E", Epress, 100)
/ responsemessage = ("I", Ipress, 100)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 90%)
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 90%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode response latency values.diff_rt values.n_responses)
</data>



nidhi_desai
nidhi_desai
Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)Associate Member (83 reputation)
Group: Forum Members
Posts: 20, Visits: 133
Dave - 1/26/2021
nidhi_desai - 1/26/2021
How can I save the response time between each response when the participant can respond multiple times during one trial?


<block myblock>
/ trials = [1=mytrial]
</block>

<values>
/ n_responses = 0
/ rt = 0
/ prev_rt = 0
/ diff_rt = 0
</values>

<trial mytrial>
/ ontrialbegin = [
    values.n_responses = 0;
    values.rt = 0;
    values.prev_rt = 0;
    values.diff_rt = 0;
]
/ stop = [
  trial.mytrial.elapsedtime >= 10000;
]
/ stimulustimes = [0=clearscreen,mytext]
/ validresponse = ("E", "I")
/ isvalidresponse = [
    if (trial.mytrial.responsetext == "E" || trial.mytrial.responsetext == "I"){
        values.n_responses += 1;
        values.rt = trial.mytrial.latency;
        values.diff_rt = values.rt - values.prev_rt;
        values.prev_rt = values.rt;
        true;
    }
]
/ responsemessage = ("E", Epress, 100)
/ responsemessage = ("I", Ipress, 100)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 90%)
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 90%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode response latency values.diff_rt values.n_responses)
</data>



Oh great, that would work! One quick question so for each response made by the participant <data> will have a new row, even if the responses are all in one <trial>?
Dave
Dave
Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)Supreme Being (914K reputation)
Group: Administrators
Posts: 11K, Visits: 65K
nidhi_desai - 1/26/2021
Dave - 1/26/2021
nidhi_desai - 1/26/2021
How can I save the response time between each response when the participant can respond multiple times during one trial?


<block myblock>
/ trials = [1=mytrial]
</block>

<values>
/ n_responses = 0
/ rt = 0
/ prev_rt = 0
/ diff_rt = 0
</values>

<trial mytrial>
/ ontrialbegin = [
    values.n_responses = 0;
    values.rt = 0;
    values.prev_rt = 0;
    values.diff_rt = 0;
]
/ stop = [
  trial.mytrial.elapsedtime >= 10000;
]
/ stimulustimes = [0=clearscreen,mytext]
/ validresponse = ("E", "I")
/ isvalidresponse = [
    if (trial.mytrial.responsetext == "E" || trial.mytrial.responsetext == "I"){
        values.n_responses += 1;
        values.rt = trial.mytrial.latency;
        values.diff_rt = values.rt - values.prev_rt;
        values.prev_rt = values.rt;
        true;
    }
]
/ responsemessage = ("E", Epress, 100)
/ responsemessage = ("I", Ipress, 100)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 90%)
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 90%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode response latency values.diff_rt values.n_responses)
</data>



Oh great, that would work! One quick question so for each response made by the participant <data> will have a new row, even if the responses are all in one <trial>?

Yes.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search