What to do if mt_check_resolution output does not look right?
Mousetrap has a function mt_check_resolution that can be used to check whether the logging resolution of the mouse positions looks okay. In the example on the mousetrap website (https://pascalkieslich.github.io/mousetrap/reference/mt_check_resolution.html) the output of this function looks like this:
#> $summary #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 1.000 10.000 10.000 9.977 10.000 14.000
Whereas for our data it looks something like this:
$summary Min. 1st Qu. Median Mean 3rd Qu. Max. 1.00 9.00 16.00 23.01 17.00 5369.00
We used PCIbex rather than OpenSesame to collect our data, and ran the experiment on the web, which may explain why our data looks less clean. Also, it seems PCIbex does not log mouse coordinates when the mouse doesn't move, to save server space, which suggests that our long timestamp intervals (up to 5s) are due to the mouse not moving.
The question now is: how to proceed when the logging resolution doesn't look as neat? We tried resampling the data using the apparent median sampling rate in the data (~60 Hz) to interpolate the long logging pauses. Is this appropriate? Are there any best practices to clean up mouse tracking data collected via the web (e.g. outlier removal)?
As a follow-up question, does anyone have experience with analyzing mouse data using mixed effects models? We're getting a lot of singular fit warnings, as well as hugely inflated random variances, especially for AUC. We are not sure how to figure out what is going on there, and whether these issues may be related to noisy data or to our (quite complex) experimental design. So any insights are welcome!
if mouse-tracking data are collected during the browser, it is indeed usually an issue that cursor positions are only recorded when the mouse is moved. To account for this issue, we extended the mt_resample function (documented here: http://pascalkieslich.github.io/mousetrap/reference/mt_resample.html) to allow for appropriately resampling the recorded positions. Specifically, we added the
constant_interpolationargument that you can specify when you know the standard sampling rate during mouse movements (we usually recommend to set it to 2 or 3 times this value). If there are breaks without recorded positions that exceed this value, the resampling function will add constant positions for this interval (instead of performing linear interpolation, please see the function documentaton for details).
In your case it seems the standard sampling interval during movements is 16 ms, so you could set constant_interpolaton to 32 or 48, like this:
mt_data <- mt_resample(mt_data, step_size = 16, constant_interpolation = 32)
Regarding the question of analyzing the measures, I would assume that particularly AUC (and MAD) should be prone to having large outlier values. An alternative measure to use could be the average deviation (AD). However, this measure should only be calculated from the resample trajectories, so in the above example, like this:
mt_data <- mt_measures(mt_data, use = "rs_trajectories")
Hope this helps!