Skip to content
Tutorials Center
My learning

Topics

Lesson 40 of 45 ยท Projects and Practice

Project: measure a reaction time

Build a reaction-time test in HTML, learn why reaction times are skewed, and analyze simulated data with an ex-Gaussian model. A hands-on sensory-motor project.

The simplest behavioral experiment in neuroscience is also one of the oldest: how long does it take you to respond to a signal? In 1850 Hermann von Helmholtz measured how quickly signals travel along a frog's nerve, a speed many thought was impossible to measure. In 1868 Franciscus Donders used reaction times to estimate the duration of mental operations. In this project you will build a test, think about what the number contains and analyze realistic data.

A reaction time is the whole sensory-motor loop
Caption: stimulus, processing and pressing add up to your reaction time.

This is a demonstration of a research method, not a diagnostic test. Many things affect your result: your device, the screen refresh, tiredness, caffeine and practice.

What you will learn

  • How to design a clean reaction-time experiment
  • Which stages contribute to the total time
  • Why reaction-time data are right-skewed and how to summarize them
  • How Donders' subtraction logic works and its limits

Key terms

Simple reaction time: time to respond to one known stimulus.

Choice reaction time: time when the response depends on which stimulus appears.

Foreperiod: the random wait before the stimulus, so you cannot predict it.

Ex-Gaussian: a distribution that is the sum of a normal and an exponential.

Median: the middle value, robust to slow outliers.

The pieces of a reaction time

For a visual simple reaction time of around 200 to 250 ms in a young adult, the budget includes: retinal processing and transmission to the cortex (tens of ms), decisions and motor planning in cortex, conduction down the corticospinal tract and spinal motor neurons, the neuromuscular delay and finally the muscle force that presses the button. Hearing is faster than vision because transduction in the ear is faster than the chemical cascade in photoreceptors, so auditory reaction times are typically a few tens of ms shorter. Reaction times grow with choice (Hick's law: roughly with the logarithm of the number of options), with tiredness and with age.

Design rules

  1. Random foreperiod (for example 1 to 4 s) so anticipation is useless.
  2. Penalize false starts: a click before the signal is not a result.
  3. Collect many trials (30 or more): single times are noisy.
  4. Report the median (and the spread), not just one number.

Build it

Reaction time tester

Analyze it

Real data look like a hump with a long tail on the slow side: lapses of attention add occasional slow trials. The mean is pulled to the right by those, so use the median or fit a distribution. The ex-Gaussian model has three parameters: mu and sigma for the bulk, and tau for the tail. Differences between groups or conditions sometimes show up mostly in tau (attention lapses) and not in mu (basic speed).

Python Simulated reaction times

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Donders and the limits of subtraction

Donders compared a simple reaction time with a choice reaction time and attributed the difference to the duration of the extra mental step (deciding). This "subtraction method" assumes that stages add up without changing each other, which is often not true. Modern methods use event-related potentials and modeling (such as drift-diffusion models), which treat choices as noisy evidence accumulating to a threshold.

Common misconceptions

"A faster time means a better brain." Speed trades against accuracy, and many factors (device, motivation, practice) matter.

"The average is the right summary." With skewed data, the median or a model is more informative.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why use a random foreperiod?

    A fixed delay lets people predict and respond early.
  2. 2. Why is the median often better than the mean for reaction times?

    Right-skewed data inflate the mean.
  3. 3. Which is typically faster?

    Auditory transduction is faster than phototransduction.
  4. 4. What does the ex-Gaussian parameter tau describe?

    Tau captures how heavy the slow tail is.

Summary

  • A reaction time sums sensory, central and motor delays.
  • Good experiments use random foreperiods, many trials and robust summaries.
  • Reaction-time data are right-skewed; models such as the ex-Gaussian describe them.

Next: Project: a receptive field