Howdy, Stranger!

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

Supported by

How to plot my aggregated trajectories using mousetrap in R

edited February 2022 in Mousetrap

Hi everyone :)

I am trying to plot the xpos and ypos from my tn_trajectories. I want the plot to look something like this, I want it to include the entire mouse tracking screen and both options illustrated with two small squares in each of the upper corners.

I preprocessed the data in the same way (time normalize, exclude initiation, align start and finish and symmetric remapping). This is how I remapped it to be symmetric:

raw_remapped <- mt_remap_symmetric(
 raw_remapped,
 use = "tn_trajectories",
 save_as = "tn_trajectories",
 dimensions = c("xpos", "ypos"),
 remap_xpos = "left",
 remap_ypos = "no")

But when I apply the mt_plot_aggregate function like this after preprocessing:

mt_plot_aggregate(raw_remapped, use="tn_trajectories", color="condition") + 
ggtitle("Aggregated trajectories") + theme_minimal()

I get this plot:

I don't understand why the trajectories start at x=350, since the mouse was reset to x=0, y=-352 at each trial round and the starting point on the y-axis is correct. From the plot you get the impression that the option not chosen was very undesirable since the trajectory is nowhere near the upper right corner. This is not the case, since the blue line indicates a stronger leaning toward the option not chosen (no) compared to the option chosen (yes). I looks like both options are to the left of the starting point, which they are not.

Please ask questions if this is confusing! I hope you can clear it up for me.


Best wishes

Sara :)

Comments

  • Hi Sara,

    could you share the complete code for preprocessing, i.e., including the part where you align the trajectories and the code you use for plotting? Also, you were writing "align start and finish" above in which case you would not have to do the subsequent remapping. If you only align at the start and not at the end, a remapping would make sense.

    Another comment, just from a first visual impression of the plot: it looks to me as if your trajectories are upside down, i.e., they are aligned at the start (in the top left) and then travel towards the bottom right (and actually deviate towards the unchosen option which would then be in the bottom left). This is often the case if trajectories are not remapped as in many software packages (e.g., in OpenSesame) raw y values increase as the cursor moves down (and not as it moves up).

    Best,

    Pascal

  • Importing the data

    raw <- mt_import_mousetrap(
      df,
      xpos_label = "xpos",
      ypos_label = "ypos",
      timestamps_label = "timestamps")
    

    Including only yes-responses

    raw <- mt_subset(raw,answer=="Yes")
    

    Time normalizing

    raw_remapped <- mt_time_normalize(raw)
    


    Align start and end coordinates.

    raw_remapped <- mt_align_start_end(raw_remapped,
              use = "tn_trajectories",
              save_as = "use",
              dimensions = c("xpos", "ypos"),
              start = c(0,0),
              end = c(-1,1),
              verbose = FALSE)
    

    Remapping to left side of the screen,

    raw_remapped <- mt_remap_symmetric(
     raw_remapped,
     use = "tn_trajectories",
     save_as = "tn_trajectories",
     dimensions = c("xpos", "ypos"),
     remap_xpos = "left",
     remap_ypos = "no"
    )
    


    When I ran through it and left out the last step of remapping it looked like this:

    I use this to plot

    aggregated <- mt_plot_aggregate(raw_remapped, use="tn_trajectories",
     color="condition") + ggtitle("Aggregated trajectories") + theme_minimal() 
    
    

    If I use the non time normalized data in mt_plot_aggregate specified in "use=tracejtories" it looks like this

    Ahh, I see how it's upside down. How do I fix that?


    Sara

  • Hi Sara,

    I think there are some minor issues with some of your code snippets above:

    raw_remapped <- mt_align_start_end(raw_remapped,
              use = "tn_trajectories",
              save_as = "use",
              dimensions = c("xpos", "ypos"),
              start = c(0,0),
              end = c(-1,1),
              verbose = FALSE)
    

    In the code above setting save_as to "use" with quotation marks does not work as it will then store the start-end-aligned trajectories actually in the "use" element. You could just leave this line out and then the start-end-aligned trajectories are stored in "tn_trajectories":

    raw_remapped <- mt_align_start_end(raw_remapped,
              use = "tn_trajectories",
              dimensions = c("xpos", "ypos"),
              start = c(0,0),
              end = c(-1,1),
              verbose = FALSE)
    

    I also don't think it makes sense to do both mt_align_start_end and mt_remap_symmetric (as the remapping will implicitly be done by mt_align_start_end). However, it could make sense to not use mt_align_start_end and instead use mt_align_start only and then mt_remap_symmetric afterwards and specify remap_ypos to "up", e.g., like this:

    # Time normalize trajectories (as was done above)
    raw_remapped <- mt_time_normalize(raw)
    
    # Align start positions
    raw_remapped <- mt_align_start(raw_remapped,
              use = "tn_trajectories",
              dimensions = c("xpos", "ypos"),
              start = c(0,0),
              verbose = FALSE)
    
    # Remap trajectories
    raw_remapped <- mt_remap_symmetric(
     raw_remapped,
     use = "tn_trajectories",
     dimensions = c("xpos", "ypos"),
     remap_xpos = "left",
     remap_ypos = "up"
    )
    
    

    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