Howdy, Stranger!

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

Supported by

mt_import_long error

Hi, I'm using mt_import_long() to import a mousetracking (repeated measures, long) dataset that was not collected in Opensesame. When I run it, I get the following error:


mt_data1 <- mt_import_long(mouse_dataincorrect, xpos_label = "X_C", ypos_label = "Y_C",timestamps_label = "timestamp", mt_id_label = "ID")

No mt_seq variable found (that indicates the order of the logs). Importing data in sequential order.

After removing trajectory data, more than one unique row per mt_id remains.


Instead of getting a list object I get an array and therefore I can't use other functions I need to use (like mt_time_normalize) that require a list. Any idea what the issue might be?


Thank you!

Comments

  • Hi there,

    would it be possible for you to share a few exemplary rows of the dataset (mouse_dataincorrect) that you use as input for the mt_import_long function? This could make it easier to understand what might be the cause of the problem here.

    Based on the warning message you mention above "After removing trajectory data, more than one unique row per mt_id remains.", one potential problem could be that you might have additional variables in your dataset (mouse_dataincorrect) that vary across the trial and that cause problems during data import. Specifically, after importing the trajectory data from the variables you specified above (X_C, Y_C, and timestamp), mt_import_mousetrap removes them from the original dataset and tries to create a trial level dataset from the remaining variables, assuming that they all remain constant for all rows of a trial (e.g., if the dataset contains the response given by the participant, this value should be constant across all rows of the trial). If there are additional variables that vary, the trial dataset is not built correctly and might cause problems in later analyses. If this is actually an issue here, you could remove the additional variables that vary across the trial from the mouse_dataincorrect dataset before using it as input for mt_import_long.

    Best,

    Pascal

  • engeng
    edited April 2021

    Hi,

    Sorry for the delayed response. Yes, that seemed to be the issue. Once I remove the non-constant variable I don't have that issue. However, I get a different error this time when I try to import the data using this function:


    mt_data1 <- mt_import_long(mouse_dataincorrect, xpos_label = "X_C", ypos_label = "Y_C",timestamps_label = "timestamp", mt_id_label = "ID")
    


    Error in trajectories[, , timestamps] - trajectories[, 1, timestamps] : 
     non-numeric argument to binary operator
    


    I think my variables have the correct structure to be imported (based on the sample script I'm following) but I'm providing a summary below in case I'm wrong:


    'data.frame':	61498 obs. of 19 variables:
     $ Order     : chr "GroupA" "GroupA" "GroupA" "GroupA" ...
     $ Duration   : int 564 564 564 564 564 564 564 564 564 564 ...
     $ ID      : chr "8968" "8968" "8968" "8968" ...
     $ timestamp   : Factor w/ 408 levels "0","100","200",..: 1 2 3 4 5 6 7 8 9 10 ...
     $ X_C      : Factor w/ 1037 levels "4","5","10","23",..: 329 329 329 329 329 329 329 329 329 329 ...
     $ Y_C      : Factor w/ 1015 levels "1","3","5","6",..: 439 439 439 439 439 439 439 439 439 439 ...
     $ Stimulus_type : chr "E2_11" "E2_11" "E2_11" "E2_11" ...
     $ Trial_duration: int 6298 6298 6298 6298 6298 6298 6298 6298 6298 6298 ...
     $ Trial_number : int 3 3 3 3 3 3 3 3 3 3 ...
     $ Condition   : Factor w/ 3 levels "Complex","Control",..: 3 3 3 3 3 3 3 3 3 3 ...
     $ Correct_X   : int 883 883 883 883 883 883 883 883 883 883 ...
     $ Correct_Y   : int 281 281 281 281 281 281 281 281 281 281 ...
     $ Incorrect_X  : int 542 542 542 542 542 542 542 542 542 542 ...
     $ Incorrect_Y  : int 394 394 394 394 394 394 394 394 394 394 ...
     $ AnsProp    : num 1.53 1.53 1.53 1.53 1.53 ...
     $ CorrProp   : num 3.14 3.14 3.14 3.14 3.14 ...
     $ DiffScore   : num -1.61 -1.61 -1.61 -1.61 -1.61 ...
     $ DiffScore1  : num 0 0 0 0 0 0 0 0 0 0 ...
     $ Acc_final   : num 0 0 0 0 0 0 0 0 0 0 ...
    
    


    I appreciate any help!

    Ester

  • Hi Ester,

    thanks for providing a summary of the data. I would agree in that the structure seems to have the correct format required by mt_import_long .

    However, based on the information on the data you provide, I think that there is an issue with the imestamp, X_C, and Y_C variables as they are of type Factorand not numor int . You could try to convert them, e.g., using the as.numeric function. However, it is probably best to first find out if there are any non-numeric values stored in these variables or if there is an issue when you read the data from file into R?

    Best,

    Pascal

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