Keeping cued response trial time constant
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Keeping cued response trial time constant Expand / Collapse
Author
Message
Posted 8/25/2008 2:34:12 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 10/27/2008 2:41:20 PM
Posts: 14, Visits: 47
I am currently attempting to design a cued response task that only allows the subject to respond when a tone sounds. When they do respond it automatically reverts to a fixation for an allotted amount of time. However I want to make it that if depending on when the subject responds the fixation is left up for that much longer so that all trials are exactly the same length. For example if I wanted a 6 second trial, and the subject responded after 2 seconds, I would want the fixation to remain visible for the remaining 4 seconds. If the subject responded after 3 seconds I would want the fixation to remain visible for another 3 seconds. Let me know if this is feasible or if clarification is needed. Thanks

-Josh


-Josh
Post #1988
Posted 8/25/2008 10:28:47 PM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVP

Group: Forum Members
Last Login: Today @ 5:01:25 PM
Posts: 336, Visits: 897
Josh,

I might have some thoughts on this, but first I must make sure that I correctly understand your trial timeline. Let's suppose each trial lasts 6000 ms. As I understand it, your trials look something like this:

- Blank screen that lasts until the subject hears a tone and presses a button (e.g., 2000 ms)
- Fixation screen that lasts the remainder of the 6000 ms trial (e.g., 4000 ms)

Please let me know if this is correct, then I might continue with some thoughts on how to proceed.

-- David McFarlane, Professional Faultfinder
Post #1990
Posted 8/26/2008 3:56:44 PM


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Moderators
Last Login: Today @ 4:36:34 PM
Posts: 129, Visits: 927
Hi Josh,

This can be handled using a bit of InLine script. For example, say that the object collecting the subject's response is named "Stimulus" and the object that appears after the subject's response (containing only the fixation) is named "Fixation". What you would need to do is set the Fixation object's Duration property so that it references an attribute. For example, you could enter [WaitDur] into the Duration property for the Fixation object.

Then, you would place an InLine immediately before the Fixation object and enter the following script:

If (6000 - (Clock.Read - Stimulus.OnsetTime)) < 0 Then
  c.SetAttrib "WaitDur", 0
Else
  c.SetAttrib "WaitDur", 6000 - (Clock.Read - Stimulus.OnsetTime)
End If

This script will take the difference between 6000 and the subject's response time and assign it to the WaitDur variable. This will then be used to set the Duration of the Fixation object, keeping your total trial length constant (i.e., 6 seconds).

There are two other things to consider:

1) Setting the Fixation object to NOT sync with a vertical blank. This can be done via the Sync tab on the Fixation object's Property Pages. Depending on how crucial it is to maintain a 6 second trial, any onset delay that occurs while waiting for the screen to refresh before the Fixation object will throw the 6000ms time limit off (i.e., the WaitDur attribute is set BEFORE the onset delay occurred).

2) You could use 6000 - Stimulus.RT, but the script I provided is a bit more accurate in the event that a millisecond or two passes from the time of the response to when the WaitDur attribute is set.

Please let me know if you have any questions.


- Matt
PST Technical Consultant
http://pstnet.com
Post #2006
Posted 8/27/2008 8:36:43 AM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVP

Group: Forum Members
Last Login: Today @ 5:01:25 PM
Posts: 336, Visits: 897
Josh,

Matt's answer is one of two strategies I had in mind. It is the strategy that 98% of users would use because it is more intuitively clear, although, as Matt explains, it requires just a bit of fancy footwork to avoid potential timing inaccuracies.

The second strategy comes down to something like the following script placed before the Fixation object:

SetNextTargetOnsetTime Stimulus.TargetOnsetTime

where the Fixation duration is set to 6000. This will pretend that Fixation started at the same time as the Stimulus, and whenever Fixation really starts it will end 6000 ms after the (target) onset of Stimulus.

This strategy also avoids potential timing inaccuracies, but in a more streamlined way. Unfortunately, it does rely on some rather obscure (though powerful) features of E-Prime (see the online E-Basic Help) -- if I used it I would make sure to fully comment what this does in the inline script.

-- David McFarlane, Professional Faultfinder
Post #2011
Posted 10/22/2008 2:54:45 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 10/27/2008 2:41:20 PM
Posts: 14, Visits: 47
Ok so I ended up not using this method for the task I described above, however I have used a version of the in-line script in another experiment currently in design. For the new task I have a 12 second stimulus (requiring a response) and 16 second fixation immediately following. When the subject responds within that 12 second window I needed that leftover time added to the 16 second fixation. So this is the in line script I included:

c. SetAttrib "WaitDur", 28000 - (Clock.Read - Stimulus.OnsetTime)

The fixation duration was set to [Waitdur] and the script was placed directly before the fixation in the procedure.

It appears to work exactly how I wanted, but I just wanted to see if I should expect any problems with this method. Thanks.


-Josh
Post #2325
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 9:23pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.078. 10 queries. Compression Disabled.