Howdy, Stranger!

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

Supported by

Unable to retrieve initiation times

Hi,

I am currently conducting an online mouse tracking experiment via Gorilla. This is what the mouse tracking data (from performing the task myself) for one trial looks like:

I have been using the following code to analyse the data in R:

library(mousetrap)

library(readxl)

library(data.table)

library(dplyr)

library(ggplot2)


#Getting the mouse tracking files from all the subfolders

xslxfiles<-list.files(pattern="*.xlsx", recursive = TRUE)


#Import all the excel files containing the mouse trajectories in the list.

xlsx.df.list<-lapply(xslxfiles,read_excel)


#Combine all these imported excel files into a single data frame. 

gorilla.traj<-rbindlist(xlsx.df.list)


###### Preparing the data for importation as an mousetrap object. ##############

#Drop all the rows that contain coordinates for the zones. In these rows there is no mouse tracking data, so we do not need

#them for now.

gorilla.traj<-gorilla.traj[gorilla.traj$type=="mouse",]


#Removing normalised data leaving the raw ones behind

gorilla.traj<-within(gorilla.traj,rm(x_normalised,y_normalised))


### keep just the relevant columns

gorilla.traj <- gorilla.traj[,c(2, 3, 5, 7, 8)]


######### Importing Gorilla data as a mousetrap object ##############

gorilla.mt<-mt_import_long(gorilla.traj,xpos_label="x",ypos_label = "y",timestamps_label = "time_stamp", mt_id_label=c("participant_id","spreadsheet_row"))


gorilla.mt<-mt_measures(gorilla.mt, use = "trajectories",save_as="measures",

            dimensions = c("xpos", "ypos"), timestamps = "timestamps",

            verbose = FALSE)

When I use the mt_measures function, the initiation times for most of the trials are recorded as 0 which seems highly unlikely. The initiation times for a very small minority of the trials are recorded accurately. I was wondering whether anyone can help me understand what has gone wrong?


Best wishes,

Hayley

Comments

  • Hi Hayley,

    one note regarding the data import: you could try out the readbulk package to make reading in the data more efficient - with your data it should work like this:

    library(readbulk)
    gorilla.traj <- read_bulk(extension = ".xlsx",fun = read_excel)
    

    Regarding the initiation times:

    First off, I don't know how Gorilla implements mouse-tracking so I can only speculate what might cause the issue.

    If they collect mouse-tracking data with standard JavaScript functions I would speculate that the problem is that the mouse cursor position is only recorded when the cursor moves. That is unlike standard lab software (e.g. MouseTracker or our mousetrap plugin for OpenSesame) you cannot simply record the position at a constant rate but only get updates whenever the mouse moves. It probably also means that the first position that is recorded by Gorilla is the one after the first movement.

    By default, mt_import_long resets the timestamps during data import so it assumes that you started moving directly at timestamp 0. You could set the reset_timestamps argument of the function to FALSE to use the absolute timestamps - but then again this only makes sense if the timestamp indicate the time since the start of the trial (which based on your spreadsheet I think does not seem to be the case).

    So in case my speculations are correct (which you should ideally verify with the Gorilla developers or the documentation), what you would need to do is to preprocess the timestamps in a way that they indicate the time since trial start. Then you could set the reset_timestamps argument to FALSE for the mt_import_long function. Afterwards, I would hope that the initiation time returned by mt_measures is correct. If not, you could us mt_resample first to resample your trajectories so that they contain a log of the position at a constant time interval and - if you know the sampling rate that Gorilla achieves (probably either 8 or 16 ms) you could set the contant_interval argument of that function to this sampling rate. Then, mt_resample automatically adds constant positions for those parts of the trial where there was no movement.

    Hope this helps!

    Best,

    Pascal

  • Hi Pascal,

    Thank you so much for your speedy response! Your speculations about Gorilla was absolutely right. I just tried out your advice and it worked like a charm!

    Best wishes,

    Hayley

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games