Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Using time variables to show how response time is calculated?

Hi there!

I am creating a reaction time experiment in OpenSesame with some of my students. I know that for reaction time measurement you can use the response time variable that is automatically created for keyboard response items. However, I thought it would be a good idea to show my students how the response time is calculated. So I thought I could just use the time variables to do this, because the reaction time should be the time difference between the time a stimulus was presented and the time the participant pressed a key as a response. I tried different combinations of variables, but I couldn't reproduce the response time given in the data file. I thought if all of my results differed from the response time by the same number of milliseconds, it might be some kind of regular delay, but the differences were variable. Could someone tell me if I'm doing something wrong?

Thank you very much in advance!

Comments

  • Hi @annma,

    You can get an approximation of the response_time variable by calculating the difference between the onset time of the stimulus and the onset of the first object following the keyboard object. With respect to the keyboard object, the time variable will only give you the onset time of the keyboard object, not the time at which the subject is pressing a key (that measure is what you get from response_time). hence the best estimation you can get is to work out the difference between the time when the keyboard starts listening for a response and the time when the next event occurs. There will be a small difference between that difference and response_time.

    I put together an example for you to see and adapt to use with your students.

    It follows a basic structure with just 3 trials where a letter comes up and the subject must respond to it by pressing any key. I then use a feedback object to display on screen some the key variables referred to above, as well as one I create in Python (you could just as well create it using Javascript if you wanted to run this online).

    Python calculation of the difference between the keyboard's onset time and the onset time of the post_keyboard sketchpad:

    var.dif = var.time_post_keyboard - var.time_keyboard
    

    Note that the dif and response_time variables will be very similar but the dif variable will always be slightly longer (by up to a few ms at times), because the completion of the keyboard object and the displaying of the post_keyboard object can take a few ms themselves.

    You can download my example here:

    Hope this helps.

    Fabrice.

    Buy Me A Coffee

  • Dear Fab,

    I'm very sorry that I didn't manage to answer you sooner and, most of all, to say thank you sooner! Your explanation helped me a lot, I could talk my students through the columns in the results sheets much better this way.

    Thank you for your time and effort!

    Kind regards,

    Anna

  • Hi @annma,

    Great! Glad I could help!

    Best,

    Fabrice.

    Buy Me A Coffee

Sign In or Register to comment.