Presenting a stimulus based on averaged stimulus reaction time

35 views
Skip to first unread message

Kipras Varkala

unread,
Aug 21, 2022, 7:40:58 PM8/21/22
to E-Prime
Hello Everyone,

What I am aiming to do is have a stimulus first be presented for 350ms and then the presentation time updated by averaging with the participants reaction time to the stimulus. For example, Trial 1: Average(350ms, 247ms) = New stimulus duration time (298ms), Trial 2: Average(350ms, 247ms, 205ms) = New stimulus duration time (267ms), etc...

//////////////Here is the code that I have written so far//////////////////////////////////////////////////////

User Script:

Dim nRT As Summation

In-Line Code (Block Level):

Set nRT = New Summation

c.SetAttrib "MeanRT", 350

In-Line Code (Trial Level AFTER stimulus presentation):

nRT.AddObservation Stimulus.RT

c.SetAttrib "MeanRT", nRT.Mean

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
The MeanRT attribute is what I have in place for the duration value for the stimulus. I have considered your previous warnings about creating a buffer between the updating function and added buffer stimuli and set the PreRelease to 0, but with no success. With all of my varied attempts I am either getting 0ms or 350ms stimulus duration times and never an average. I suspect I am not updating the attributes properly.

Please let me know if there is any other relevant information I can provide.

Thank you for your time,
Kipras

David McFarlane

unread,
Aug 25, 2022, 4:01:46 PM8/25/22
to e-p...@googlegroups.com
Kipras,

At the trial level, try moving the line

c.SetAttrib "MeanRT", nRT.Mean

to InLine code BEFORE stimulus presentation instead of after.

Also, try setting Generate PreRun of your stimulus object to
"BeforeObjectRun".

-- David McFarlane


On 2022-08-21 Sun 7:40 PM, Kipras Varkala wrote:
> Hello Everyone,
>
> What I am aiming to do is have a stimulus first be presented for 350ms
> and then the presentation time updated by averaging with the
> participants reaction time to the stimulus. For example, Trial 1:
> Average(350ms, 247ms) = New stimulus duration time (298ms), Trial 2:
> Average(350ms, 247ms, 205ms) = New stimulus duration time (267ms), etc...
>
> //////////////Here is the code that I have written so
> far//////////////////////////////////////////////////////
>
> _User Script:_
> _
> _
> Dim nRT As Summation
>
> _In-Line Code (Block Level):_
>
> Set nRT = New Summation
>
> c.SetAttrib "MeanRT", 350
>
> _In-Line Code (Trial Level AFTER stimulus presentation):_

Kipras Varkala

unread,
Sep 13, 2022, 8:52:30 PM9/13/22
to E-Prime
David,

Thank you! It works now :)

Best,
Kipras

Reply all
Reply to author
Forward
0 new messages