Howdy, Stranger!

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

Supported by

mt_aggregate

Hi,

I want to aggregate my data. I need a table where I can see "MAD" for each of my participants in each of my three conditions. I tried a lot of functions from mousetrap-package but my trajectories don`t have the same length so most of the time I get warning messages ("In mt_reshape(data = data, use = use, use_variables = use_variables, : For some trials in data[[use2]], no corresponding trials in data[[use]] were found.").

It would be great if anyone could help me - I need this for my master thesis.

Comments

  • Hi,

    could post the code you used for aggregation? This would help me identifying the underlying problem. If you want to aggregate the MAD values, trajectories of different length should not be a problem per se.

    Best,

    Pascal

  • Hi,

    test3<-mt_aggregate_per_subject(gorilla_mt, use = "measures", use_variables = "MAD",

                    use2 = "data", use2_variables = "condition", subject_id="participant_id",

                    trajectories_long = TRUE)

    Best, Leonie

  • Hi Leonie,

    that code looks fine to me. The message above seems to suggest that some trials can only be found in gorilla_mt$data but not in gorilla_mt$measures. Could you maybe, in a first step, check that the number of rows is them same:

    nrow(gorilla_mt$data)

    nrow(gorilla_mt$measures)

    If this differs, we should take a look at your preprocessing code.

    Best,

    Pascal

  • Hi Pascal,

    yes they differ:

    > nrow(gorilla_mt$data)

    [1] 3155

    > nrow(gorilla_mt$measures)

    [1] 72

    Best,

    Leonie

  • Hi Leonie,

    this points to a problem during the preprocessing. Could you share your code, starting with the import of the trajectories until you run mt_measures?

    In addition, could you share any warning messages you receive? I would speculate that you probably already get a warning message during the import?

    Best,

    Pascal

  • Hi Pascal,

    > gorilla_mt<-mt_import_long(gorilla.traj,xpos_label="x",ypos_label = "y",timestamps_label = "time_stamp", mt_id_label="spreadsheet_row")

    warning message: No mt_seq variable found (that indicates the order of the logs). Importing data in sequential order. Warnmeldung: In mt_import_long(gorilla.traj, xpos_label = "x", ypos_label = "y", : After removing trajectory data, more than one unique row per mt_id remains.

    > gorilla_mt<-mt_measures(gorilla_mt, use="trajectories", save_as = "measures", dimensions=c("xpos", "ypos"), timestamps = "timestamps",verbose=FALSE)


    Best,

    Leonie

  • Hi Leonie,

    I think this warning message is the cause of the problem:

    "Warnmeldung: In mt_import_long(gorilla.traj, xpos_label = "x", ypos_label = "y", : After removing trajectory data, more than one unique row per mt_id remains."

    This suggest that there are additional variables in gorilla.traj (apart from x, y, and time_stamp) that vary within the trial. You either need to remove them before import or specify them in mt_import_long via the add_labels argument.

    (Note: I assume that 81 is the correct number of trials you expect?).

    Best,

    Pascal

  • Hi Pascal,

    I think I found the problem:

    In gorilla.traj I have the variable "spreadsheet_row". This shows me which stimulus was presented to the participant. Now I see that in gorilla.traj I have too much spreatsheet_rows per trial.

    (for example: I have for participant xy spreadsheet_row 32 ninety times. This is quite too much and I didn`t presented each stimulus that often to the participants.

    Is there any way to aggregate at this position so that I have per participant one value of x and y and timestamp per spreadsheet_row?

    The correct number of trials I expect is 72.

    Best, Leonie

  • Hi Leonie,

    I have to say that I am not 100 % sure that I understand your raw data format (from the name of your dataset I would infer you are using Gorilla, but I don't know how the data format of Gorilla looks like).

    Based on the import function from the mousetrap package you selected (mt_import_long) I would infer that your data is in a long format. That means, each recorded position in each trial is stored in its own row. So a dataset might look like this (where id codes the participant and spreadsheet_row the stimulus that was presented):

    id  x  y  time_stamp  spreadsheet_row
    1   0  0    0         1
    1   3  0    10        1
    1   3  1    20        1
    1   4  1    30        1
    1   5  1    40        1
    1   0  0    50        1
    ...
    1   0  0    0         2
    1   3  0    10        2
    1   3  1    20        2
    1   4  1    30        2
    1   5  1    40        2
    1   0  0    50        2
    ...
    2   0  0    0         1
    2   3  0    10        1
    2   3  1    20        1
    2   4  1    30        1
    2   5  1    40        1
    2   0  0    50        1
    
    

    So if this is the case, the import function you specified should be correct, although you might have to specify the participant id as an additional identifier, in case spreadsheet_row values repeat for different praticipants, like this:

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


    If you this is correct, the problem could still be cause by the fact that you record an additional variable in the dataset that varies for each recorded position - you would have to remove this before import or specified it via the add_labels argument.

    Does this make sense? If not, it would be great if you could share an example of your raw data format here.

    Best

    Pascal

  • Hi Pascal,

    WOW! Thank you very much! This fixed my problem :)

    Best, Leonie

  • Hi Pascal,

    My data collection method has resulted in a 2(condition) x 2(order) design meaning I'm combining 4 spreadsheets together. I've created a unique variable that is condition_order_spreadsheetrow (named spreadsheet_row)

    However when I specify this as a label I still get the error:

    gorilla.mt<-mt_import_long(gorilla.traj2,xpos_label="x",ypos_label = "y",timestamps_label = "time_stamp", 

                  mt_id_label=c("participant_id","spreadsheet_row"), reset_timestamps = FALSE)

    Warning message:

    In mt_import_long(gorilla.traj2, xpos_label = "x", ypos_label = "y", :

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


    Any help will be much appreciated.

  • Hi,

    I think that the reason for this warning message is that there are additional columns in your dataset that vary within the trial (aside from x, y and time_stamp). So, for example, assuming that you have additional columns called "vel" and "acc" that record the velocity and acceleration at a specific position, you have to specifiy the name of these columns during data import via the add_labels argument (or you need to remove these columns from gorilla.traj2 before using mt_import_long):

    gorilla.mt <- mt_import_long(gorilla.traj2,
      xpos_label="x",ypos_label = "y",timestamps_label = "time_stamp",
      add_labels= c("vel", "acc"),
      mt_id_label=c("participant_id","spreadsheet_row"), reset_timestamps = FALSE)
    

    Alternatively, something with the id labels might not work properly.

    Best,

    Pascal

  • Hi Pascal,

    Sorry I did not see that you had replied to any of these messages. I'm no longer having the import errors (I combined the data from 4 different spreadsheets so I just needed to include spreadsheet number as well as ppt id and spreadsheet row).

    The other issues in the other post still remain.

    Thanks for getting back to me.

  • Hi,

    good to hear that your import errors got resolved!

    Regarding the other issues: could you post the link to the discussion you are referring to?

    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