Stimulus duration pegged to average RT

19 views
Skip to first unread message

huw....@gmail.com

unread,
Aug 9, 2015, 6:21:16 AM8/9/15
to E-Prime
Hi Everyone, I am trying to run a procedure in which participants respond to a stimulus during a practice trial, and then again during an experimental trial. In the latter, I want the duration of this stimulus object to be determined by participants' average RT to it in the practice. I have managed to do this using the code below, but when I try and extend it into another context (i.e. use the same "MeanPracticeReactionTime"attribute in a new inline, within a new procedure), it is not working. Can anyone see where I am going wrong?

Thanks in advance!



'User Tab:

Dim g_nTotalTrialCount As Integer

Dim g_TotalPracticeRT As Integer

Dim g_MeanPracticeRT As Integer


'Inline 1:

g_nTotalTrialCount = 0

g_TotalPracticeRT = 0

g_MeanPracticeRT = 0

'Inline to update Trial count

g_nTotalTrialCount = g_nTotalTrialCount + 1

c.SetAttrib "TrialCount", g_nTotalTrialCount

'Inline to calculate average RT:

g_TotalPracticeRT = g_TotalPracticeRT + PracProbe2.RT
c.SetAttrib "TotalPracticeRT", g_TotalPracticeRT

g_MeanPracticeRT = g_TotalPracticeRT / g_nTotalTrialCount
c.SetAttrib "MeanPracticeRT", g_MeanPracticeRT

'Inline to set Stimulus Duration to average RT from the previous procedure:

c.SetAttrib "MeanPracticeReactionTime", g_MeanPracticeRT

David McFarlane

unread,
Aug 11, 2015, 10:47:21 AM8/11/15
to e-p...@googlegroups.com
What does "not working" mean here? Please give more detail. Do you
get any specific error message.

Also, you might find a Summation object useful for deriving average
values -- please see that topic in the E-Basic Help facility.

-----
David McFarlane
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster)
Reply all
Reply to author
Forward
0 new messages