<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.biophysics.science.ru.nl/index.php?action=history&amp;feed=atom&amp;title=Saccade_analysis</id>
	<title>Saccade analysis - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.biophysics.science.ru.nl/index.php?action=history&amp;feed=atom&amp;title=Saccade_analysis"/>
	<link rel="alternate" type="text/html" href="https://wiki.biophysics.science.ru.nl/index.php?title=Saccade_analysis&amp;action=history"/>
	<updated>2026-08-09T17:39:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.biophysics.science.ru.nl/index.php?title=Saccade_analysis&amp;diff=3162&amp;oldid=prev</id>
		<title>Lof: Created page with &quot;&lt;a href=&quot;images/avhistogram.png&quot; rel=&quot;rokbox(gallery)&quot; title=&quot;Audiovisual Reaction time&quot;&gt;&lt;img src=&quot;images/avhistogram.png&quot; alt=&quot;image&quot; width=&quot;103&quot; height=&quot;99&quot; class=&quot;rt-image...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.biophysics.science.ru.nl/index.php?title=Saccade_analysis&amp;diff=3162&amp;oldid=prev"/>
		<updated>2024-01-22T13:03:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;a href=&amp;quot;images/avhistogram.png&amp;quot; rel=&amp;quot;rokbox(gallery)&amp;quot; title=&amp;quot;Audiovisual Reaction time&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;images/avhistogram.png&amp;quot; alt=&amp;quot;image&amp;quot; width=&amp;quot;103&amp;quot; height=&amp;quot;99&amp;quot; class=&amp;quot;rt-image...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;a href=&amp;quot;images/avhistogram.png&amp;quot; rel=&amp;quot;rokbox(gallery)&amp;quot; title=&amp;quot;Audiovisual Reaction time&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;images/avhistogram.png&amp;quot; alt=&amp;quot;image&amp;quot; width=&amp;quot;103&amp;quot; height=&amp;quot;99&amp;quot; class=&amp;quot;rt-image floatleft&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;clearnone&amp;quot;&amp;gt; &amp;lt;a href=&amp;quot;http://www.neural-code.com/index.php/panda/about-panda&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;PANDA&amp;lt;/a&amp;gt; tutorial, for students and coworkers:  This is a short and simple introduction on how to analyze saccades. Students will be introduced to reaction times, histograms, selection vectors, and cumulative probability.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;hr id=&amp;quot;system-readmore&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt; Saccade data &amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;After you have followed a &amp;lt;a href=&amp;quot;http://www.math.toronto.edu/mpugh/primer.pdf&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;Matlab Introduction&amp;lt;/a&amp;gt; course (or have read the first chapters of &amp;lt;a href=&amp;quot;http://www.elsevier.com/books/matlab-for-neuroscientists/wallisch/978-0-12-374551-4&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;Matlab for Neuroscientists&amp;lt;/a&amp;gt;), you may want to try your newly-found MatLab powers at analyzing actual data. The data for this tutorial can be found &amp;lt;a href=&amp;quot;http://www.mbfys.ru.nl/staff/m.vanwanrooij/neuralcode/data/AVsaccade.mat&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;. The &amp;lt;a href=&amp;quot;http://www.neural-code.com/index.php/panda/about-panda&amp;quot; target=&amp;quot;_parent&amp;quot;&amp;gt;PANDA&amp;lt;/a&amp;gt; toolbox is also required, together with an &amp;lt;a href=&amp;quot;http://www.mbfys.ru.nl/staff/m.vanwanrooij/neuralcode/data/index.m&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;index m-file&amp;lt;/a&amp;gt;.  The data for this tutorial is from one subject (BC), from a &amp;lt;a href=&amp;quot;http://jn.physiology.org/content/88/1/438.long&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;study on audiovisual integration&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt; Background &amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Specifically, this data is obtained from our study on &amp;lt;a href=&amp;quot;http:jn.physiology.org/cgi/content/full/88/1/438&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;Auditory-Visual Interactions Subserving Goal-Directed  Saccades  in a Complex Scene&amp;lt;/a&amp;gt;. In this study, subjects had to search for a light, a sound or both among a large number of distractor lights and sounds. The task was to respond as rapidly as possible by generating a voluntary rapid eye movement or saccade. We concluded that responses to a synchronously-presented light and sound followed a &amp;amp;quot;best of both worlds&amp;amp;quot; principle: they were as fast as auditory saccades, yet as accurate as visual saccades. What you will be doing in this tutorial, is determining whether subject BC was faster for audiovisual stimuli than for the auditory or visual stimuli, when the sound lagged the light by 100 ms.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt; Multisensory reaction times &amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; First, you need to load the &amp;lt;a href=&amp;quot;http://www.mbfys.ru.nl/staff/m.vanwanrooij/neuralcode/data/AVsaccade.mat&amp;quot;&amp;gt;data&amp;lt;/a&amp;gt; into the MatLab workspace. For this, you have to go to the directory where you stored the data and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre xml:lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
cd(&amp;#039;C:\DATA&amp;#039;);&lt;br /&gt;
load(&amp;#039;AVsaccade.mat&amp;#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
This action will produce a matrix stored in the MatLab workspace called &amp;lt;em&amp;gt;sac&amp;lt;/em&amp;gt;, which is 409 rows long and 9 colums wide. You can check this with the function whos, which will show all variables stored in the workspace.&lt;br /&gt;
&amp;lt;pre xml:lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; whos&lt;br /&gt;
  &lt;br /&gt;
  Name        Size            Bytes  Class     Attributes&lt;br /&gt;
  &lt;br /&gt;
sac       412x7             32200  double &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; SAC matrix  &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In each &amp;lt;em&amp;gt;row&amp;lt;/em&amp;gt; of the &amp;lt;em&amp;gt;sac&amp;lt;/em&amp;gt; matrix &amp;lt;strong&amp;gt;all&amp;lt;/strong&amp;gt; saccade parameters of &amp;lt;strong&amp;gt;one&amp;lt;/strong&amp;gt; particular saccade are stored. Vice versa, each column of the &amp;lt;em&amp;gt;sac&amp;lt;/em&amp;gt; matrix represents &amp;lt;strong&amp;gt;one&amp;lt;/strong&amp;gt; particular parameter for &amp;lt;strong&amp;gt;all&amp;lt;/strong&amp;gt; saccades. The saccade parameters of each column can be obtained in MATLAB by typing:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre xml:lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; index&lt;br /&gt;
&lt;br /&gt;
  And [[http:www.mbfys.ru.nl/staff/m.vanwanrooij/Downloads/index.m|this m-file]] will display in the command window:&lt;br /&gt;
  Rows&lt;br /&gt;
  Each row contains saccade parameters for a single trial &lt;br /&gt;
  Columns: &lt;br /&gt;
  1 Trial Number &lt;br /&gt;
  2 Saccade    Latency       [ms] &lt;br /&gt;
  3 Saccade Amplitude        [deg] &lt;br /&gt;
  4 Saccade direction        [deg] &lt;br /&gt;
  5 Saccade Duration         [ms] &lt;br /&gt;
  6 Peak Saccade Velocity    [deg/s]&lt;br /&gt;
  7 Modality					(1 - Visual&lt;br /&gt;
  2 - Auditory -6 dB&lt;br /&gt;
  3 - Auditory -18 dB&lt;br /&gt;
  4 - Audiovisual -6dB&lt;br /&gt;
  5 - Audiovisual -18 dB)&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Below, the first ten rows of the sac matrix parameters are listed: &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre xml:lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; sac(1:10,:)&lt;br /&gt;
  &lt;br /&gt;
  ans =&lt;br /&gt;
  &lt;br /&gt;
  1.0000  224.0000   12.5494  295.7188   48.0000  458.1762    4.0000&lt;br /&gt;
  4.0000  310.0000   16.2406   46.2253   60.0000  449.6114    5.0000&lt;br /&gt;
  7.0000  354.0000   14.6940  271.6397   56.0000  431.0925    1.0000&lt;br /&gt;
  17.0000  484.0000   15.5194  211.1216   60.0000  431.1098    1.0000&lt;br /&gt;
  18.0000  290.0000   20.8366  196.1716   72.0000  420.6550    3.0000&lt;br /&gt;
  19.0000  258.0000   12.7184   96.0820   54.0000  389.2359    3.0000&lt;br /&gt;
  23.0000  358.0000   16.8306  244.8486   62.0000  455.7257    3.0000&lt;br /&gt;
  24.0000  322.0000   13.7645  290.5611   54.0000  417.3952    3.0000&lt;br /&gt;
  32.0000  248.0000   19.7672    3.1488   74.0000  422.2016    5.0000&lt;br /&gt;
  39.0000  306.0000   17.1490  288.7840   60.0000  497.6191    5.0000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;p&amp;gt;To reiterate, saccades are listed in subsequent rows. From the first column (Trial Number according to &amp;lt;em&amp;gt;index&amp;lt;/em&amp;gt;), you can see that you are missing some trials, as the numbers are not consecutive.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Is this because the saccades are randomly placed within the matrix causing you to miss some trial numbers in the first ten rows (e.g. if you &lt;br /&gt;
    &amp;lt;pre xml:lang=&amp;quot;matlab&amp;quot;&amp;gt;sort&amp;lt;/pre&amp;gt; the trial numbers, do you find 412 &amp;lt;pre xml:lang=&amp;quot;matlab&amp;quot;&amp;gt;unique&amp;lt;/pre&amp;gt; consecutive trial numbers from 1 to 412) or are some trials actually absent from the sac matrix?  &amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;The second row contains saccade latency, or reaction time (in ms). This is the time it takes to respond with a saccade after the onset of the target. The last (7th) row tells you the modality of the target: 1 means the stimulus was visual, 2 and 3 are auditory stimuli, 4 and 5 are audiovisual targets. This column tells us that of the first ten saccades of the matrix, two were visually-guided, four were aurally-guided, and four were audiovisual.  How many visual trials were there in total? And how many were auditory and visual?&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Multisensory vs unisensory reaction time &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Next, you have to determine which modality elicits the fastest responses. What is the mean reaction time for visual, auditory, and audiovisual responses? Make the same figure as plotted above.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;use &amp;lt;pre xml:lang=&amp;quot;matlab&amp;quot;&amp;gt;hist&amp;lt;/pre&amp;gt; to make histograms of the reaction times for each modality (use selection vectors to select for each modality. Use 20-msec wide bins, starting at 0 and ending at 600).&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Plot these histograms (probability vs reaction time), use red for visual (&amp;#039;r&amp;#039;), blue for auditory (&amp;#039;b&amp;#039;), and green for audiovisual (&amp;#039;g&amp;#039;) responses in a single graph: hold on. Use correct labeling: &amp;lt;pre xml:lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
  xlabel&lt;br /&gt;
  ylabel&lt;br /&gt;
  legend&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Note that on the y-axis probability is plotted, not the number of responses per reaction time bin (as obtained by &amp;lt;em&amp;gt;hist&amp;lt;/em&amp;gt;). You have to normalize by the total number of saccades: &amp;lt;pre xml:lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
  length&lt;br /&gt;
  size&lt;br /&gt;
  sum&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;images/avhistogram.png&amp;quot; rel=&amp;quot;rokbox(gallery)&amp;quot; title=&amp;quot;Audiovisual Reaction time&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;images/avhistogram.png&amp;quot; alt=&amp;quot;image&amp;quot; width=&amp;quot;254&amp;quot; height=&amp;quot;242&amp;quot; class=&amp;quot;rt-image&amp;quot; title=&amp;quot;Figure 1. Probability histogram of saccadic reaction times to visual, auditory or audiovisual targets. red - visual; blue - auditory; green - audiovisual&amp;quot;/&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Cumulative Probability  &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;It is more informative to express the reaction time distributions as cumulative percentage probabilities on a probit scale (i.e. inverted gaussian) as a function of the reciprocal reaction time (-1/RT). In this manner, Gaussian distributions will appear as a straight line. Try this out yourself (or have a &amp;lt;a href=&amp;quot;http://www.neural-code.com/index.php/tutorials/action/reaction-time/83-reciprobit-distribution&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;look here&amp;lt;/a&amp;gt;).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;And here is an example code that can create the graph as shown above. Try to write this code yourself first! Note the use of:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;sub-functions&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;clear labeling of the m-file and the graphics&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;pre xml:lang=&amp;quot;matlab&amp;quot;&amp;gt;function webtutorial_sac&lt;br /&gt;
% WEBTUTORIAL_SAC&lt;br /&gt;
%&lt;br /&gt;
% An m-file producing the graph in the Saccade Introduction Tutorial&amp;lt;/p&amp;gt;&lt;br /&gt;
% Main function&lt;br /&gt;
&lt;br /&gt;
% First, let us clear data and plots&lt;br /&gt;
clear all&lt;br /&gt;
close all&lt;br /&gt;
clc&lt;br /&gt;
&lt;br /&gt;
% Now let&amp;#039;s load the data&lt;br /&gt;
% Make sure that you are in the correct directory!&lt;br /&gt;
% cd(&amp;#039;C:\DATA&amp;#039;);&lt;br /&gt;
load AVsaccade&lt;br /&gt;
&lt;br /&gt;
%% Let&amp;#039;s make a historgam&lt;br /&gt;
% Bins&lt;br /&gt;
x	= 0:20:600;&lt;br /&gt;
&lt;br /&gt;
% Probability&lt;br /&gt;
PV	= getprob(sac,1,x);		% Visual&lt;br /&gt;
PA	= getprob(sac,2:3,x);	% Auditory&lt;br /&gt;
PAV	= getprob(sac,4:5,x);	% Audiovisual&lt;br /&gt;
&lt;br /&gt;
%% And let&amp;#039;s plot these distributions&lt;br /&gt;
figure(1)&lt;br /&gt;
plot(x,PV,&amp;#039;r&amp;#039;,&amp;#039;LineWidth&amp;#039;,2);&lt;br /&gt;
hold on&lt;br /&gt;
plot(x,PA,&amp;#039;b&amp;#039;,&amp;#039;LineWidth&amp;#039;,2);&lt;br /&gt;
plot(x,PAV,&amp;#039;g&amp;#039;,&amp;#039;LineWidth&amp;#039;,2);&lt;br /&gt;
axis square&lt;br /&gt;
xlabel(&amp;#039;Reaction time (ms)&amp;#039;);&lt;br /&gt;
ylabel(&amp;#039;Probability&amp;#039;);&lt;br /&gt;
xlim([100 500])&lt;br /&gt;
legend(&amp;#039;Visual&amp;#039;,&amp;#039;Auditory&amp;#039;,&amp;#039;Audiovisual&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
function P = getprob(sac,mod,x)&lt;br /&gt;
% Sub-function&lt;br /&gt;
% P = GETPROB(SAC,MOD,X)&lt;br /&gt;
% Get reaction time probability distribution P for saccades SAC with&lt;br /&gt;
% modality MOD, at bins X.&lt;br /&gt;
sel = ismember(sac(:,7),mod);&lt;br /&gt;
N	= hist(sac(sel,2),x);&lt;br /&gt;
P	= N/sum(N);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lof</name></author>
	</entry>
</feed>