| Reference | Downloads | Github

Understanding mouse movement data

Hi all,

I’ll start collecting data for an experiment where I’ll be looking at mouse movements, in particular at the velocity with which participants move the mouse from left to right. Everything is working fine with the code, but I would like to understand a bit better how Psychopy is recording the data from the mouse movements.
There are two columns from the Excel file that I’m particularly interested in: mouse.x and mouse.time

The mouse.x data looks like this:

The mouse.time data looks like this:

As you can see, there are many 0 in mouse.x. This is normal, since after moving the mouse from left to right, the mouse is set to stop in the middle of the screen.

My general question is: what is the correct way of interpreting these two columns in my data? Is it correct to say that each data point in mouse.x is a recording of the horizontal mouse position for that particular frame? And if that is the case, would it be correct to say, then, that when, e.g. mouse.time= 0.9945 (first data point in mouse.time), the mouse was located in mouse.x= -0.7 (first data point in mouse.x), and so on with every data point?


The first thing to do here would be to plot the data as a time series of x vs t to see if it looks meaningful and well-behaved.

Hi Michael,

It does. Or at least it looks like it does. What the code seems to be doing is that it records the location of the mouse and the time every frame, so at the end I get two columns with the same number of data points, and I can match every location of the mouse to a particular time stamp. So basically I see this:

How should I interpret the TIME column, are these milliseconds?

No, those are seconds, and you can see that the sampling is occurring at roughly 60 Hz (the refresh rate of your display), as each sample is separated by ~16.7 ms.