<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Mousetrap — Forum</title>
        <link>https://forum.cogsci.nl/</link>
        <pubDate>Thu, 12 Mar 2026 10:19:31 +0000</pubDate>
        <language>en</language>
            <description>Mousetrap — Forum</description>
    <atom:link href="https://forum.cogsci.nl/categories/mousetrap/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>Accessing measures in dataframe?</title>
        <link>https://forum.cogsci.nl/discussion/9720/accessing-measures-in-dataframe</link>
        <pubDate>Tue, 25 Feb 2025 21:36:17 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>dwbatten</dc:creator>
        <guid isPermaLink="false">9720@/discussions</guid>
        <description><![CDATA[<p>Hi there,</p><p>I&#39;m using the Mousetrap R package to analyze some mousetracking data I collected in PsychoPy.</p><p>I&#39;ve been doing some things in R beyond the package working with exported wide and long mousetracking data that Mousetrap got into shape for me, but I&#39;d love to be able to also access the measures that Mousetrap calculates (particularly AUC and MD).</p><p>Is it possible to access that? Or might I be doing something wrong in how I&#39;m exporting?</p><p>I&#39;ve been processing it in with this code to get my mt data, but I wished I could get the measures to come through, too.</p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/835/QN4KSOB70YV1.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/835/QN4KSOB70YV1.png" alt="image.png" />
        </a>
    </div>
</div>
<p>Thanks!</p>]]>
        </description>
    </item>
    <item>
        <title>mt_remap_symmetric</title>
        <link>https://forum.cogsci.nl/discussion/9672/mt-remap-symmetric</link>
        <pubDate>Mon, 20 Jan 2025 14:40:06 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>ZZZ</dc:creator>
        <guid isPermaLink="false">9672@/discussions</guid>
        <description><![CDATA[<p>Hi</p><p>&quot;My code encountered some difficulties again, and it seems that the problem occurred during the mt_remap_symmetric step. My issue is that the origin is at the top-left corner of the screen, meaning that both the x and y coordinates increase as you move down and to the right, and there are no negative values. After performing the remapping with the default mt_remap_symmetric code, the result looks strange. So, what should I do to mirror the right-side trajectories to the left?&quot;</p><p>Any advice would be greatly appreciated.</p><p>Below is my code and data structure</p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/307/PMSJI06USXB8.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/307/PMSJI06USXB8.png" alt="Rplot02.png" />
        </a>
    </div>
</div>
<pre spellcheck="false">library(mousetrap)
library(readbulk)
&gt; raw_data &lt;- read_bulk(directory = &quot;D:/networkanalysis/xsbdata&quot;, extension = &quot;.csv&quot;)
mt_data &lt;- mt_import_wide(raw_data,
+                           xpos_label = &quot;x&quot;,
+                           ypos_label = &quot;y&quot;,
+                           zpos_label = NULL,
+                           timestamps_label = &quot;t&quot;,
+                           mt_id_label = NULL,
+                           pos_sep = &quot;_&quot;,
+                           reset_timestamps = TRUE,
+                           verbose = TRUE
+ )
No mt_id_label provided. A new trial identifying variable called mt_id was created.
No pos_ids provided. The following variables were found using grep:
1240 variables found for timestamps.
1240 variables found for xpos.
1240 variables found for ypos.
 # 定义dimensions，假设你需要对齐 &#39;xpos&#39; 和 &#39;ypos&#39; 维度
&gt; dimensions &lt;- c(&#39;xpos&#39;, &#39;ypos&#39;)
&gt; # 对齐轨迹数据
&gt; mt_data &lt;- mt_align_start(
+     mt_data,
+     start = NULL,  # 使用平均起始点对齐
+     verbose = TRUE
+ )
No start coordinates were provided. Aligning to: 681.921875,709.196354166667
&gt; 
&gt; mt_data &lt;- mt_remap_symmetric(
+     mt_data,
+     use = &quot;trajectories&quot;,
+     save_as = &quot;trajectories&quot;,
+     dimensions = c(&quot;xpos&quot;, &quot;ypos&quot;),
+     remap_xpos = &quot;left&quot;,
+     remap_ypos = &quot;up&quot;
+ )
&gt; 
&gt; mt_data &lt;- mt_exclude_initiation(mt_data,
+                                  use=&quot;trajectories&quot;,              # 使用轨迹数据
+                                  save_as=&quot;trajectories&quot;,      # 保存修改后的结果
+                                  dimensions=c(&quot;xpos&quot;,&quot;ypos&quot;),     # 指定位置维度，假设是 &#39;xpos&#39; 和 &#39;ypos&#39;
+                                  timestamps=&quot;timestamps&quot;,         # 时间戳字段名称
+                                  reset_timestamps=TRUE,           # 是否重置时间戳
+                                  verbose=TRUE                     # 显示进度信息
+ )
mt_data &lt;- mt_exclude_finish(
+     mt_data,
+     use = &quot;trajectories&quot;,
+     save_as = &quot;trajectories&quot;,
+     dimensions = c(&quot;xpos&quot;, &quot;ypos&quot;),
+     timestamps = &quot;timestamps&quot;,
+     verbose =TRUE 
+ )
 mt_data &lt;- mt_length_normalize(
+     mt_data,
+     use = &quot;trajectories&quot;,         # 原始轨迹数据
+     dimensions = c(&quot;xpos&quot;, &quot;ypos&quot;),
+     save_as = &quot;ln_trajectories&quot;,  # 保存归一化的轨迹
+     n_points = 20                 # 归一化后的轨迹点数
+ )
&gt; 
&gt; mt_data &lt;- mt_time_normalize(
+     mt_data,
+     use = &quot;trajectories&quot;,
+     save_as = &quot;tn_trajectories&quot;,
+     dimensions = c(&quot;xpos&quot;, &quot;ypos&quot;),
+     timestamps = &quot;timestamps&quot;,
+     nsteps = 101,
+     verbose = FALSE
+ )
&gt; 
&gt; mt_data &lt;- mt_measures(
+     mt_data,  # 使用整个mt_data对象，包含处理后的轨迹数据
+     use = &quot;ln_trajectories&quot;,  # 使用长度归一化的轨迹
+     save_as = &quot;measures&quot;,  # 将计算结果存储到&quot;measures&quot;数据框中
+     dimensions = c(&quot;xpos&quot;, &quot;ypos&quot;),  # 计算x和y位置
+     timestamps = &quot;timestamps&quot;,  # 使用时间戳列
+     flip_threshold = 0,  # 设置 flip 阈值
+     verbose = TRUE  # 启用详细输出
+ )
 agg_data &lt;- mt_aggregate_per_subject(
+     mt_data,                        # 你的数据对象
+     use_variables = &quot;xpos_flips&quot;,           # 计算 AUC 值
+     use2_variables = &quot;exp_type&quot;,    # 使用 exp_type 进行分组
+     subject_id =&quot;subID&quot;                # 不需要按 subID 分组
+ )
&gt; 
&gt; t.test(xpos_flips ~ exp_type, data = agg_data)
 agg_data &lt;- mt_aggregate_per_subject(
+     mt_data,                        # 你的数据对象
+     use_variables = &quot;AUC&quot;,           # 计算 AUC 值
+     use2_variables = &quot;exp_type&quot;,    # 使用 exp_type 进行分组
+     subject_id =&quot;subID&quot;                # 不需要按 subID 分组
+ )
&gt; 
&gt; t.test(AUC ~ exp_type, data = agg_data)
mt_plot(mt_data, use=&quot;tn_trajectories&quot;, color=&quot;exp_type&quot;)

    
        <a href="https://forum.cogsci.nl/uploads/715/Q7G683FC9OUM.png" rel="nofollow noopener" target="_blank">
            </a></pre><img src="https://forum.cogsci.nl/uploads/715/Q7G683FC9OUM.png" alt="Rplot01.png" />
        
    

<pre spellcheck="false">mt_plot_aggregate(mt_data, use=&quot;tn_trajectories&quot;, color=&quot;exp_type&quot;, subject_id=&quot;subID&quot;)
</pre><p><br /></p>]]>
        </description>
    </item>
    <item>
        <title>An error occurred while entering the add_labels</title>
        <link>https://forum.cogsci.nl/discussion/9642/an-error-occurred-while-entering-the-add-labels</link>
        <pubDate>Sun, 22 Dec 2024 16:21:05 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>ZZZ</dc:creator>
        <guid isPermaLink="false">9642@/discussions</guid>
        <description><![CDATA[<p>Hello, when I input CSV data, after adding add_labels, for example add_labels = c(&quot;pic_type&quot;), I will get an error error in mt_import_wide(data, xpos_label = &quot;x&quot;, ypos_label = &quot;y&quot;, add_labels = c(&quot;pic_type&quot;), :&nbsp;</p><p>&nbsp;No variables found for pic_type.</p><p>My fully entered code is below</p><p>mt_data &lt;- mt_import_wide(data,</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xpos_label = &quot;x&quot;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ypos_label = &quot;y&quot;,&nbsp;&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zpos_label = NULL,</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timestamps_label = &quot;t&quot;,&nbsp;&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;add_labels = c(&quot;pic_type&quot;, &quot;subID&quot;, &quot;exp_type&quot;, &quot;rt&quot;, &quot;response&quot;, &quot;left&quot;, &quot;right&quot;, &quot;correctresponse&quot;),</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mt_id_label = NULL,</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pos_sep = &quot;_&quot;,</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reset_timestamps = TRUE,</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;verbose = TRUE</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)</p>]]>
        </description>
    </item>
    <item>
        <title>Changing labels of facets in mt_plot</title>
        <link>https://forum.cogsci.nl/discussion/9446/changing-labels-of-facets-in-mt-plot</link>
        <pubDate>Fri, 02 Aug 2024 07:48:23 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>revatis2</dc:creator>
        <guid isPermaLink="false">9446@/discussions</guid>
        <description><![CDATA[<p>Hello!</p><p>I am plotting trajectory types. I want to change the facet columns&#39; names to something else. I tried the following with no luck:</p><pre spellcheck="false">facet_labels = c(&quot;35%&quot;, &quot;25%&quot;, &quot;10%&quot;, &quot;5%&quot;, &quot;5%&quot;)
mt_plot(mt_data,
&nbsp; &nbsp; &nbsp; &nbsp; use2 = &quot;prototyping&quot;,
&nbsp; &nbsp; &nbsp; &nbsp; facet_col = &quot;prototype_label&quot;,
&nbsp; &nbsp; &nbsp; &nbsp; alpha = .05)
+ facet_wrap(labeller = as_labeller(facet_labels))
</pre><p>This throws the following error:</p><pre spellcheck="false">Error in facet_wrap(labeller = as_labeller(facet_labels)) : 
  argument &quot;facets&quot; is missing, with no default
</pre><p>What should I do?</p>]]>
        </description>
    </item>
    <item>
        <title>Deviation from straight line up</title>
        <link>https://forum.cogsci.nl/discussion/9339/deviation-from-straight-line-up</link>
        <pubDate>Wed, 29 May 2024 22:03:06 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>MouseM</dc:creator>
        <guid isPermaLink="false">9339@/discussions</guid>
        <description><![CDATA[<p>If I want to compute the MAD and AUC from a straight line up, how would I do that? </p><p>My data looks like below</p><p><br /></p><p>I tried </p><p>mt &lt;- mt_align(mt, coordinates = c(0, 0, -1, 1.2124))</p><p>mt &lt;- mt_time_normalize(mt)</p><p>I then use some custom code to flip some of the trajectories to the left based on a given condition</p><p>mt&lt;- mt_deviations(mt,end_ideal = c(0, 1.2124))</p><p>followed by mt_measures, but my AUC and MAD  occasionally come back positive - even though my data clearly shows a trend to the left (with the exception of one trajectory) </p><p>xpos_min shows up as expected</p><p>It seems to be doing something with whether the first xpos_max is positive or negative to some extent, but I cant use mt_align with align_start because it makes the trajectories weird</p><p><br /></p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/325/2HCHGWL7VCQG.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/325/2HCHGWL7VCQG.png" alt="Screenshot 2024-05-29 at 5.41.22 PM.png" />
        </a>
    </div>
</div>
<p><br /></p>]]>
        </description>
    </item>
    <item>
        <title>Drag and drop; Mouse trap; Back-end</title>
        <link>https://forum.cogsci.nl/discussion/9300/drag-and-drop-mouse-trap-back-end</link>
        <pubDate>Thu, 09 May 2024 14:26:32 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>Lorenzon</dc:creator>
        <guid isPermaLink="false">9300@/discussions</guid>
        <description><![CDATA[<p>Hello,</p><p>I&#39;m trying to use the mouse trap function in my experiment that is based on drag and dropping some stimulus on a horizzontal line. I entirely defined the task with python script without using any opensesame integrated element. The experiment (build with psychopy backend) works very well. The problem now is related to mousetracking data collection. I realyzed that there is no compatibility between psychopy and mousetrap. So, as i change the backend in legacy or xpyriment the logic i wrote for the drag and drop doesnt&#39; works anymore as it doesnt&#39; fits well with legacy or xpyriment.</p><p>Do you have any suggestion on how resolve this problem?</p><p>Kind regards,</p><p>Lorenzo</p>]]>
        </description>
    </item>
    <item>
        <title>New User - unexpected error</title>
        <link>https://forum.cogsci.nl/discussion/9234/new-user-unexpected-error</link>
        <pubDate>Sat, 06 Apr 2024 15:28:43 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>selhoh0027</dc:creator>
        <guid isPermaLink="false">9234@/discussions</guid>
        <description><![CDATA[<p>Hello! I am still very new to opensesame and have very little programming experience, so I have encountered an issue to which I can&#39;t seem to find a solution by myself.</p><p>I am planning to conduct an experiment where participants are instructed to select the lager/smaller number of a presented pair by clicking on the correct answer and I want to use mouse-tracking to observe the path of the participants&#39; responses using the mousetrap plug-in.</p><p>The structure of my experiment is very similar to the example_experiment for the mousetrap function, so I used it as a guide on how to incorporate the mousetrap response in the script but I always get an Unexpected Error I can&#39;t make sense of. </p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/889/8H6MFPTFEH0I.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/889/8H6MFPTFEH0I.png" alt="traceback_1.png" />
        </a>
    </div>
</div>
<div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/263/MDE77JWVR19Q.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/263/MDE77JWVR19Q.png" alt="traceback_2.png" />
        </a>
    </div>
</div>
<div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/558/086RKJJZIMSN.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/558/086RKJJZIMSN.png" alt="traceback_3.png" />
        </a>
    </div>
</div>
<p>From what I gathered, a KeyError means that the program is not able to access the items (number pairs)? I have no idea how to fix this though, as the experiment runs perfectly and smoothly when i use the keyboard response option for example - no errors and correct presentation of my items.</p><p>Any idea what I can do differently/have to change to make it work?</p><p>Thanks in advance :D</p>]]>
        </description>
    </item>
    <item>
        <title>Warning in regularize.values during mt_resample</title>
        <link>https://forum.cogsci.nl/discussion/6410/warning-in-regularize-values-during-mt-resample</link>
        <pubDate>Fri, 21 Aug 2020 07:33:27 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>kalenkovich</dc:creator>
        <guid isPermaLink="false">6410@/discussions</guid>
        <description><![CDATA[<p>When I run <code spellcheck="false">mt_resample</code> , I get the following warings:</p><pre spellcheck="false">Warning in regularize.values(x, y, ties, missing(ties)) :
&nbsp; collapsing to unique &#39;x&#39; values
Warning in regularize.values(x, y, ties, missing(ties)) :
&nbsp; collapsing to unique &#39;x&#39; values
Warning in regularize.values(x, y, ties, missing(ties)) :
&nbsp; collapsing to unique &#39;x&#39; values
</pre><p>Can I simply ignore them?</p><p>I&#39;ve attached a single trajectory to this post. Here is the code I used:</p><pre spellcheck="false">mt_trial_with_warning &lt;- readRDS(&#39;mt_trial_with_warning.rds&#39;)
mt_trial_with_warning &lt;- mt_resample(mt_trial_with_warning, step_size = 20)
</pre><p>My R version is 3.6.1, mousetrap&#39;s is 3.1.4.</p><div data-embedjson="{&quot;url&quot;:&quot;https:\/\/forum.cogsci.nl\/uploads\/384\/PFK7CQ61G4HR.zip&quot;,&quot;name&quot;:&quot;mt_trial_with_warning.zip&quot;,&quot;type&quot;:&quot;application\/x-zip-compressed&quot;,&quot;size&quot;:1537,&quot;embedType&quot;:&quot;file&quot;}">
    <a rel="nofollow" href="https://forum.cogsci.nl/uploads/384/PFK7CQ61G4HR.zip" download="" aria-label="mt_trial_with_warning.zip">
        mt_trial_with_warning.zip
    </a>
</div><p><br /></p>]]>
        </description>
    </item>
    <item>
        <title>mt_import_long() issue</title>
        <link>https://forum.cogsci.nl/discussion/9082/mt-import-long-issue</link>
        <pubDate>Fri, 19 Jan 2024 16:08:31 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>Michel</dc:creator>
        <guid isPermaLink="false">9082@/discussions</guid>
        <description><![CDATA[<p>My trajectory data contain only 3 columns, with respectively time, x coord and y coord.</p><p>As mt_import_long() requires also an ID column, I have added it to the data frame, then imported the (single tracking) data with :</p><pre spellcheck="false">&gt; mt_track &lt;- mt_import_long(track, xpos_label = &quot;xpos&quot;, ypos_label = &quot;ypos&quot;, timestamps_label = &quot;time&quot;,
+                            mt_id_label = &quot;ID&quot;)
No mt_seq variable found (that indicates the order of the logs). Importing data in sequential order.
</pre><p>which creates a list :</p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/491/VES42SLJX0NL.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/491/VES42SLJX0NL.png" alt="image.png" />
        </a>
    </div>
</div>
<p>However, that does not seem to be a functional mt object, as </p><pre spellcheck="false">&gt; mt_check_resolution(mt_track)
Error in trajectories[, , timestamps] : incorrect number of dimensions
&gt; mt_plot(mt_track)
Error in dimnames(dataset)[[3]] : subscript out of bounds
</pre><p>What am I doing wrong in this basic first step ?</p><p>Best regards,</p><p>Michel</p>]]>
        </description>
    </item>
    <item>
        <title>Importing multiple .mt files into one frame</title>
        <link>https://forum.cogsci.nl/discussion/9009/importing-multiple-mt-files-into-one-frame</link>
        <pubDate>Mon, 04 Dec 2023 16:13:26 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>MvG</dc:creator>
        <guid isPermaLink="false">9009@/discussions</guid>
        <description><![CDATA[<div data-embedjson="{&quot;url&quot;:&quot;https:\/\/forum.cogsci.nl\/uploads\/202\/PV6X5LX35DBI.zip&quot;,&quot;name&quot;:&quot;Experiment.zip&quot;,&quot;type&quot;:&quot;application\/x-zip-compressed&quot;,&quot;size&quot;:39381,&quot;embedType&quot;:&quot;file&quot;}">
    <a rel="nofollow" href="https://forum.cogsci.nl/uploads/202/PV6X5LX35DBI.zip" download="" aria-label="Experiment.zip">
        Experiment.zip
    </a>
</div><p>Hi, I am completely new to MouseTracker and RStudio. I just finished data collection for my study and now I am trying to analyze the data. </p><p><br /></p><p>I have put all my data in the map called &quot;raw_data&quot; and selected this as working directory in RStudio. Both mousetrap and readbulk libraries are installed. Now I would like to read all files in one frame with the following code:</p><p><em># Load libraries</em></p><p><em>library(mousetrap)</em></p><p><em>library(readbulk)</em></p><p><br /></p><p><em># Use read_bulk to read all raw data files ending with &quot;.mt&quot; that are</em></p><p><em># stored in the folder &quot;raw_data&quot; (in the current working directory)</em></p><p><em>mt_data_raw &lt;- read_bulk(&quot;raw_data&quot;, fun=read_mt, extension=&quot;.mt&quot;)</em></p><p><br /></p><p><em># Import the data into mousetrap</em></p><p><em>mt_data &lt;- mt_import_wide(mt_data_raw)</em></p><p>I get the following message: Warning message:</p><pre spellcheck="false">In read_bulk(&quot;raw_data&quot;, fun = read_mt, extension = &quot;.mt&quot;) :
  Final data.frame has 0 rows. Please check that directory was specified correctly.
</pre><p><br /></p><p>How can I solve this?  I have tried loading one single file with the following code which was successful</p><p><em># Read a single raw data file from MouseTracker</em></p><p><em># (stored in the current working directory)</em></p><p><em>mt_data_raw &lt;- read_mt(&quot;99_231204_1520.mt&quot;)</em></p><p><br /></p><p>I don&#39;t see why a single file is successful but mering multiple files into one frame not. </p><p><br /></p><p>Thank you so much in advance!☺️</p>]]>
        </description>
    </item>
    <item>
        <title>New User - Drag and Drop Interactive Stimulus?</title>
        <link>https://forum.cogsci.nl/discussion/8813/new-user-drag-and-drop-interactive-stimulus</link>
        <pubDate>Tue, 12 Sep 2023 15:35:49 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>amoore23</dc:creator>
        <guid isPermaLink="false">8813@/discussions</guid>
        <description><![CDATA[<p>Hi. New user here. Is it possible to use the mouse tracking package to create an interface that allows subjects to drag and drop images (or click to duplicate them?), where the feedback causes the image to update in response to the user&#39;s input? </p><p>For example, if there were two .png files displayed at the bottom of the screen, the subject would have to drag &amp; drop each of them to different locations on the screen, and the screen should update to show their new locations.</p><p>Thanks!</p>]]>
        </description>
    </item>
    <item>
        <title>something wrong when running example</title>
        <link>https://forum.cogsci.nl/discussion/8718/something-wrong-when-running-example</link>
        <pubDate>Fri, 28 Jul 2023 07:15:23 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>jianguo</dc:creator>
        <guid isPermaLink="false">8718@/discussions</guid>
        <description><![CDATA[<p>hi,i would like to use mousetracking plugin in opensesame.as said in <a href="https://github.com/PascalKieslich/mousetrap-os#development-version" rel="nofollow">GitHub - PascalKieslich/mousetrap-os: Mouse-tracking plugin for OpenSesame</a>,i run the command as follow,because my opensesame&#39;s version is 4.0.0a33.</p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/983/5K9F6GB7RAM2.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/983/5K9F6GB7RAM2.png" alt="image.png" />
        </a>
    </div>
</div>
<p>and then i open one of the example,such as mousetrap_form.and when i tried to run the experiment,there is something wrong.an AttributeError appear.</p><p>File &quot;D:\opensesame\Lib\site-packages\openexp\_mouse\legacy.py&quot;, line 115, in get_pos</p><p>&nbsp;&nbsp;return self.from_xy(pygame.mouse.get_pos()), self.experiment.time()</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^^^^^^^^^^^^^^^^^^^^</p><p>AttributeError: &#39;Experiment&#39; object has no attribute &#39;time&#39;</p><p>i wondering what is wrong with it,and how could i run it.</p><p>thanks.</p><p>jianguo</p>]]>
        </description>
    </item>
    <item>
        <title>Issues with read_mt</title>
        <link>https://forum.cogsci.nl/discussion/8824/issues-with-read-mt</link>
        <pubDate>Tue, 19 Sep 2023 13:17:37 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>carrieb</dc:creator>
        <guid isPermaLink="false">8824@/discussions</guid>
        <description><![CDATA[<p>I&#39;ve successfully used read_mt in the past with Mousetracker files containing trial type 1 but am now using trial type 4. With trial type 4 read_mt throws the error below. Any ideas on what the issue may be?</p><p>Error in dimnames(x) &lt;- dn :&nbsp;</p><p>length of &#39;dimnames&#39; [2] not equal to array extent</p>]]>
        </description>
    </item>
    <item>
        <title>Mouse-tracking indices</title>
        <link>https://forum.cogsci.nl/discussion/8498/mouse-tracking-indices</link>
        <pubDate>Fri, 31 Mar 2023 23:07:08 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>CogSciNLinguist</dc:creator>
        <guid isPermaLink="false">8498@/discussions</guid>
        <description><![CDATA[<p>Hi <a data-username="Pascal" data-userid="418" rel="nofollow" href="https://forum.cogsci.nl/profile/Pascal">@Pascal</a> ,</p><p>I hope you are well.</p><p>I was wondering if you could recommend any articles/text that will help me understand the specific differences between MAD, AD and AUC, regarding what exactly these indices are thought to measure in terms of psychology constructs. </p><p>Are we able to say, for example, that one of these reflects degrees of cognitive effort whereas the other reflects cognitive conflict? Or do they all measure the same thing but in slightly different ways?</p><p>Thank you for your support!</p>]]>
        </description>
    </item>
    <item>
        <title>quantile points on mt_plot</title>
        <link>https://forum.cogsci.nl/discussion/8512/quantile-points-on-mt-plot</link>
        <pubDate>Tue, 11 Apr 2023 06:40:19 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>Matin</dc:creator>
        <guid isPermaLink="false">8512@/discussions</guid>
        <description><![CDATA[<p>Hello,</p><p>I am currently drawing some trajectory plots with mt_plot_aggregate like this:</p><p>Traj &lt;- mt_plot_aggregate(data = mt_data, use=&quot;tn_trajectories&quot;, color=&quot;condition&quot;, subject_id=&quot;subjID&quot;, size=1.0) &nbsp;+ scale_color_manual(values=c(&quot;#00BFC4&quot;, &quot;#F8766D&quot;, &quot;grey&quot;), labels = c(&quot;Phonological&quot;, &quot;Semantic&quot;, &quot;Unrelated&quot;)) + xlim(-1000, 300) + ylim(-100, 1100) +&nbsp;&nbsp;geom_point()</p><p>However, I don&#39;t want to have all the &#39;points&#39; on my trajectory but only 10th, 20th,...100th points. I wonder if you know how to do this with MT data? </p><p><br /></p><p>Wenting</p>]]>
        </description>
    </item>
    <item>
        <title>Save dataframe as a &quot;.mt&quot; file</title>
        <link>https://forum.cogsci.nl/discussion/8414/save-dataframe-as-a-mt-file</link>
        <pubDate>Fri, 17 Feb 2023 13:12:06 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>Zhimin</dc:creator>
        <guid isPermaLink="false">8414@/discussions</guid>
        <description><![CDATA[<p>I collected mt data using MouseTracker and mistakenly coded two participants with the same name.</p><p>I used the read_mt function in moustrap to change the subjID of one participant, but I couldn&#39;t save that dataframe as a &quot;.mt&quot; file after I made changes, as there is no write_mt function. </p><p>I also tried to create a &quot;.mt&quot; file using the write.table function, but it doesn&#39;t work.</p><p>Alternatively, I could read_bulk all the raw &quot;.mt&quot; files, but two participants have the same subjID and stimuli, so I don&#39;t know how to change one of their subjIDs properly.</p><p>Could somebody please help me to resolve this issue?</p>]]>
        </description>
    </item>
    <item>
        <title>Cutting trajectories at a particular time point</title>
        <link>https://forum.cogsci.nl/discussion/8334/cutting-trajectories-at-a-particular-time-point</link>
        <pubDate>Wed, 21 Dec 2022 14:05:55 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>apl92</dc:creator>
        <guid isPermaLink="false">8334@/discussions</guid>
        <description><![CDATA[<p>Hi all</p><p>I have some mouse tracking trajectories where participants hear &quot;Click on the X&quot; where X is a word, that changes across a number of trials. As this is naturalistic speech, the length of the carrier phrase &#39;Click on the&#39; is variable, and I want to remove the portion of the trajectories that before participants hear X.</p><p>I have the lengths of the carrier phrases stored in a data file. I can match across mouse tracking data (mt_data$data) and trajectories (mt_data$trajectories) by mt_id, so no problem there. However, I don&#39;t know how to cut the trajectories, being unfamiliar with arrays.</p><p>How would one go about this? Having performed this analysis, only then would I want to calculate measures etc</p>]]>
        </description>
    </item>
    <item>
        <title>Stimuli appearing while mouse is in motion</title>
        <link>https://forum.cogsci.nl/discussion/8316/stimuli-appearing-while-mouse-is-in-motion</link>
        <pubDate>Sun, 11 Dec 2022 16:28:28 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>Mokady</dc:creator>
        <guid isPermaLink="false">8316@/discussions</guid>
        <description><![CDATA[<p>Hi,</p><p>I am new both to Open Sesame and to mouse-tracking and trying to build my first experiment.</p><p>In my experiment participants press start, the main stimulus appears immediately and they start the mouse movement with an initiation time limit (like in classic mouse-tracking studies). After a certain time delay, while the mouse is in motion, I need to present a second set of stimuli without stopping the mouse tracking (specifically, I&#39;ll show money bonus amounts above each choice to compete with the initial motivation the choices created).</p><p>I didn&#39;t find an option to set a delayed onset for stimuli in the same sketchpad, if this is possible it would solve my problem. The other option I am thinking about is tracking mouse movement across sketchpads but I am not sure if and how to do so.</p><p>I also tried creating 2 sketchpads with 2 mousetrap_resposne objects, but both the timing of the screens and the data storing is off when I do so.</p><p>Is one of these options possible or is there a different one that will allow me to create such an experiment?</p><p><br /></p><p>Thanks in advance for any help provided,</p><p>Aviv Mokady</p>]]>
        </description>
    </item>
    <item>
        <title>mt_remap_symmetric() Error in if ((remap_ypos == &quot;up&quot; &amp; trajectories[i, nlogs, ypos] &lt; 0) |  :</title>
        <link>https://forum.cogsci.nl/discussion/8224/mt-remap-symmetric-error-in-if-remap-ypos-up-trajectories-i-nlogs-ypos-0</link>
        <pubDate>Wed, 26 Oct 2022 14:15:04 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>alexamb</dc:creator>
        <guid isPermaLink="false">8224@/discussions</guid>
        <description><![CDATA[<p>Hello all!</p><p><br /></p><p>I&#39;ve been using mousetrap for a project I&#39;m working on at my job and have usually been able to figure out any issues I have, but I keep coming across an error for one subject in the data. Whenever I try to remap the data I get this error: </p><p>Error in if ((remap_ypos == &quot;up&quot; &amp; trajectories[i, nlogs, ypos] &lt; 0) |&nbsp;:&nbsp;</p><p>&nbsp;missing value where TRUE/FALSE needed</p><p><br /></p><p>I&#39;m not quite sure how to fix this and the only thing I can say about the data is that the subject that completed the task had some trouble (i.e. click on the wrong picture, go to the wrong picture and hover over it then go to the right picture, or even not move the mouse for a few seconds aka dozing off) </p><p><br /></p><p>Any input would help because this is the only error I come across when I run the mousetrap preprocessing steps (mt_align_start, mt_time_normalize, mt_subset). Thanks!</p>]]>
        </description>
    </item>
    <item>
        <title>New User - mouse tracking question</title>
        <link>https://forum.cogsci.nl/discussion/8187/new-user-mouse-tracking-question</link>
        <pubDate>Wed, 05 Oct 2022 14:53:30 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>lolaloppem</dc:creator>
        <guid isPermaLink="false">8187@/discussions</guid>
        <description><![CDATA[<p>Hi there, I&#39;m totally new to OpenSesame but excited about the possibilities it has for a super short experiment I will be running.</p><p><br /></p><p>I want to present a video, with/without subtitles, and show distracting elements to either side of the video. I&#39;d like to be able to measure the amount of mouse movement and/or clicks over these distraction elements. </p><p><br /></p><p>I&#39;m continuing to do research on the platform and watching tutorials, but I wanted to check if anyone here has run a similar type of experiment and if there are existing pieces of code within OS to achieve what I&#39;m looking for! </p><p>Thanks in advance for your help :)</p>]]>
        </description>
    </item>
    <item>
        <title>mousetrap merging trajectories</title>
        <link>https://forum.cogsci.nl/discussion/8165/mousetrap-merging-trajectories</link>
        <pubDate>Wed, 21 Sep 2022 08:33:10 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>Matin</dc:creator>
        <guid isPermaLink="false">8165@/discussions</guid>
        <description><![CDATA[<p>Hello I am currently running my experiment with mousetrap.os and trying to analyse the data. In my results, I can see trajectories were saved under different variables corresponding to different blocks in my design (here I got 4 blocks: block_c, block_diff, block_mixed and block_s). This is how it looks in one subject&#39;s .csv file:</p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/030/45YNZA8IMM7R.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/030/45YNZA8IMM7R.png" alt="image.png" />
        </a>
    </div>
</div>
<p>According to my design, each trial should contain only one trajectory, so for example, xpos in block_c should all be stored in &quot;xpos_get_response_c&quot;, and NAs in other columns.</p><p>However, when switching to the next block, for example, from block_c to block_s, the last trajectory was copied and pasted throughout that column..</p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/492/5QOSIVQX8PH8.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/492/5QOSIVQX8PH8.png" alt="image.png" />
        </a>
    </div>
</div>
<p>...and when I go to the last block (block_diff), all four columns were filled</p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/840/3920WHW93UP2.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/840/3920WHW93UP2.png" alt="image.png" />
        </a>
    </div>
</div>
<p>This makes a problem when I run &quot;mt_import_opensesame&quot;, only the first column of trajectories (in this case, xpos_get_response_c) was kept and it makes the raw trajectories/tn_trajectories weird (probably the redundant trajectory was overweighted). Here is what I put for &quot;mt_import_opensesame&quot;:</p><pre spellcheck="false">mt_data &lt;- mt_import_mousetrap(mt_data_raw,&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xpos_label = c(&quot;xpos_get_response_c&quot;, &quot;xpos_get_response_s&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;xpos_get_response_mixed&quot;,&quot;xpos_get_response_diff&quot;),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ypos_label = c(&quot;ypos_get_response_c&quot;, &quot;ypos_get_response_s&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;ypos_get_response_mixed&quot;,&quot;ypos_get_response_diff&quot;),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timestamps_label = c(&quot;timestamps_get_response_c&quot;, &quot;timestamps_get_response_s&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;timestamps_get_response_mixed&quot;,&quot;timestamps_get_response_diff&quot;),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;digits = 2)
</pre><p>Could you please tell me if there is anything I have done it wrongly? Or shall I change any setting in my mousetrap.os file? Thank you so much!</p><p><br /></p><p>Best,</p><p>Wenting</p>]]>
        </description>
    </item>
    <item>
        <title>remapping trajectories based on a data condition</title>
        <link>https://forum.cogsci.nl/discussion/8003/remapping-trajectories-based-on-a-data-condition</link>
        <pubDate>Wed, 25 May 2022 14:32:36 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>statwood</dc:creator>
        <guid isPermaLink="false">8003@/discussions</guid>
        <description><![CDATA[<p>Hello, </p><p><br /></p><p>I&#39;m writing to see if it&#39;s possible to remap time-normalized trajectories in different directions based on a data condition in Mousetrap. Currently I have a graph that looks like this (with all aggregated trajectories being remapped to the left): </p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/419/P04Z20EJWYAU.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/419/P04Z20EJWYAU.png" alt="Screen Shot 2022-05-23 at 11.01.00 AM.png" />
        </a>
    </div>
</div>
<p>But I would like to split them up based on target gender to look more like this (with aggregated trajectories of female targets going to the right and aggregated trajectories of male targets going to the left): </p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/545/KF3VSJPH836P.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/545/KF3VSJPH836P.png" alt="male participants.png" />
        </a>
    </div>
</div>
<div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/091/IAE7UBQ2SJAZ.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/091/IAE7UBQ2SJAZ.png" alt="female participants.png" />
        </a>
    </div>
</div>
<p><br /></p><p>My current (brute force) workaround is that I subsetted my mousetrap data based on target gender using the mt_subset function, remapped each subset individually (see below), visualized them separately, and then frankensteined this &quot;combined&quot; plot in powerpoint, but I was hoping that someone who is more knowledgeable about Mousetrap might know of a more elegant (and reproducible) solution. Thank you in advance for any advice!</p><p><br /></p><p>mt_remapped_male &lt;- mt_remap_symmetric(</p><p>&nbsp;mt_aligned_male,</p><p>&nbsp;use = &quot;tn_trajectories&quot;,</p><p>&nbsp;dimensions = c(&quot;xpos&quot;, &quot;ypos&quot;),</p><p>&nbsp;remap_xpos = &quot;left&quot;,</p><p>&nbsp;remap_ypos = &quot;up&quot;)</p><p><br /></p><p>mt_remapped_female &lt;- mt_remap_symmetric(</p><p>&nbsp;mt_aligned_female,</p><p>&nbsp;use = &quot;tn_trajectories&quot;,</p><p>&nbsp;dimensions = c(&quot;xpos&quot;, &quot;ypos&quot;),</p><p>&nbsp;remap_xpos = &quot;right&quot;,</p><p>&nbsp;remap_ypos = &quot;up&quot;)</p>]]>
        </description>
    </item>
    <item>
        <title>Remapping trajectories to both sides (sorta)</title>
        <link>https://forum.cogsci.nl/discussion/4738/remapping-trajectories-to-both-sides-sorta</link>
        <pubDate>Tue, 15 Jan 2019 01:11:02 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>MikeD</dc:creator>
        <guid isPermaLink="false">4738@/discussions</guid>
        <description><![CDATA[<p>I may be overthinking this question...</p>

<p>I have responses that I've counterbalanced across participants. Half of people saw "BLUE" on the left and "PURPLE" on the right and half saw "PURPLE" on the left and "BLUE" on the right. However, I'd like to graph them without remapping them all to one side. (I suspect there's an inherent motor bias and I'd like to look at the trajectories going to different sides of the screen to check this out).</p>

<p>I tried using the following code from your paper Pascal but it remapped trajectories so that all factors were going to both sides.</p>

<p><code>d.var$side &lt;- ifelse(d.var$response_get_RESP==d.var$RESP_LEFT, "left", "right")</code></p>

<p><code>MT &lt;- mt_remap_symmetric(MT, remap_xpos = "no")</code></p>

<p><code>mt_plot_aggregate(MT2,                    use = "tn_trajectories", points = F,                    x = "xpos", y = "ypos",                    subject_id = "subject_nr",                   color = "RESPxCOLOR",                   linetype = "side",                   facet_col = "TRIAL")</code></p>

<p>The code above maps both BLUE and PURPLE responses to both left and right.</p>

<p>What I want is all BLUE responses to be mapped to the left and all PURPLE responses to be mapped to the right (even though they were counter balanced across participants). Then the trajectories can be broken down by my other factor (color: blue, purple, ambiguous). Three trajectories to the blue response in the left corner, three trajectories to the purple response in the right corner.</p>
]]>
        </description>
    </item>
    <item>
        <title>Using mousetrap in visual world</title>
        <link>https://forum.cogsci.nl/discussion/7857/using-mousetrap-in-visual-world</link>
        <pubDate>Sat, 12 Mar 2022 22:06:05 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>suleyman_yaman</dc:creator>
        <guid isPermaLink="false">7857@/discussions</guid>
        <description><![CDATA[<p>Hi all, </p><p>I&#39;m new to the forum and OpenSesame. I&#39;m designing a visual world experiment where the participants will view the pictures on the screen while listening to short commands in English (e.g. put the apple on the napkin). They wil also be required to act out these commands through mouse within a predetermined amount of time, which requires mousetrap plugin on OpenSesame. In the visual world tutorial <a href="https://osdoc.cogsci.nl/3.3/tutorials/visual-world/#extra-3-analyze-eye-position-online-challenging" rel="nofollow">here</a>,  I understand that coroutines should be employed to be able to analyze eye position during the experiment. However, mousetrap plugin is not apparently compatible with coroutines as I receive an error message &quot;&quot;track_actions does not support coroutines.&quot; when I attempt to add mousetrap_response item under coroutines. Is there any possible workaround for this?</p>]]>
        </description>
    </item>
    <item>
        <title>Trajectory alignment issues</title>
        <link>https://forum.cogsci.nl/discussion/7935/trajectory-alignment-issues</link>
        <pubDate>Thu, 14 Apr 2022 17:47:38 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>carlotta_isabella</dc:creator>
        <guid isPermaLink="false">7935@/discussions</guid>
        <description><![CDATA[<p>Dear Pascal and everyone,</p><p>My apologies for the lengthy post, I tried to be as specific as possible in my problem description and to include all relevant <code spellcheck="false">code</code>, <strong><code spellcheck="false">warnings </code></strong>and output.</p><p>I am having problems aligning trajectories to common start- and end-points. I have collected data with E-Prime GO and imported them with<code spellcheck="false"> mt_import_long()</code>. My design requires participants to start from the bottom center of the screen and choose one of both responses at the top corners of the screen. Responses need to be given in order to proceed, and there are no missing points in my raw dataset (24 items x 85 participants). Location of correct responses is counterbalanced, so half of the trajectories end in the top left, half in the top right corner.</p><p><code spellcheck="false">mtdata &lt;- mt_import_long(mt_prepdata, xpos_label = &quot;xpos&quot;, ypos_label = &quot;ypos&quot;, mt_id_label = c(&quot;Subject&quot;, &quot;Sample&quot;), mt_seq_label = &quot;timestep&quot;, reset_timestamps = T)</code></p><p><strong><code spellcheck="false">No timestamps were found in the data. Artificial timestamps variable created assuming equidistant time steps.</code></strong></p><p>This assumption should be warranted, because my sampling rate was constant at 25ms.</p><p>[Sidebar: while preparing the dataset before import, I ended up with columns of coordinates over time: xpos, ypos, t. To my confusion, &quot;t&quot; is logged as &quot;absolute&quot; time in ms, rather than relative to trial onset, i.e., it is calculated from the beginning of the experiment in successive 25ms-steps. As a consequence, rather than having &quot;t&quot;-sequences from 0ms, they start from the ms in which participants gave the first mouse-tracking response during the experiment, after other cognitive assessments, so e.g., 4598349867 ms or something ridiculous like that).</p><p>I believe it is for this reason that the data looked weird when plotting them right after import:</p><p><code spellcheck="false">mt_plot_aggregate(mtdata, use=&quot;trajectories&quot;, x=&quot;xpos&quot;, y=&quot;ypos&quot;, color=&quot;condition&quot;, subject_id=&quot;Subject&quot;)</code></p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/573/NFJE7ECESX8J.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/573/NFJE7ECESX8J.png" alt="image.png" />
        </a>
    </div>
</div>
<p>To avoid this, I deleted the &quot;t&quot; column from the data to be imported with mousetrap. To replace the &quot;t&quot; variable, I created a &quot;timestep&quot; column (before mt_import_long) by creating a number sequence for each x-y-coordinate pair which restarts every time SubjectID and/or the ItemID change. However, the &quot;timestep&quot; variable created by me does not seem to be recognized when I specify it as the &quot;timestamps&quot; variable at import (hence the warning message about equidistant timestamps being created automatically). After these steps, I get plots that look more sensible right after import, as compared to importing with the &quot;t&quot; variable.</p><p><code spellcheck="false">mt_plot_aggregate(mtdata, use=&quot;trajectories&quot;, x=&quot;xpos&quot;, y=&quot;ypos&quot;, color=&quot;condition&quot;, subject_id=&quot;Subject&quot;)</code></p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/707/332S8VEOIM3Y.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/707/332S8VEOIM3Y.png" alt="image.png" />
        </a>
    </div>
</div>
<p><code spellcheck="false">mt_plot(mtdata, use = &quot;trajectories&quot;, use2 = &quot;data&quot;, x = &quot;xpos&quot;, y = &quot;ypos&quot;, color = &quot;SentCond&quot;, alpha = NA, size = .1, mt_id = &quot;mt_id&quot;, subject_id = &quot;Subject&quot;) </code></p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/595/4QMNFGSYZLHF.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/595/4QMNFGSYZLHF.png" alt="image.png" />
        </a>
    </div>
</div>
<p>[End of sidebar]</p><p>Clearly, however, the data needed some more cleaning. To eliminate trials that started and ended in the same position, I used the following code (from another thread in this forum):</p><p><code spellcheck="false">mtdata$data$pos_var &lt;- apply(mtdata$trajectories[,,&quot;xpos&quot;],1,var,na.rm=TRUE) + apply(mtdata$trajectories[,,&quot;ypos&quot;],1,var,na.rm=TRUE)</code></p><p><code spellcheck="false">table(mtdata$data$pos_var==0)</code></p><p><strong><code spellcheck="false">FALSE&nbsp;TRUE </code></strong></p><p><strong><code spellcheck="false">&nbsp;2010&nbsp;&nbsp;&nbsp;30 </code></strong></p><p><code spellcheck="false">mtdata &lt;- mt_subset(mtdata,mtdata$data$pos_var&gt;0)</code></p><p><code spellcheck="false">nrow(mtdata$data)</code></p><p><strong><code spellcheck="false">[1] 2010</code></strong></p><p>After this step, the plotted data look exactly like the image above (unsurprisingly).</p><p>I eliminated all trajectories from incorrectly answered trials:</p><p><code spellcheck="false">mtdata &lt;- mt_subset(mtdata, mtdata$data$accuracy==1)</code></p><p>I then use <code spellcheck="false">mt_remap_symmetric() </code>(without any further arg specification). Now the same plot looks like this:</p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/056/OAB633LECJGI.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/056/OAB633LECJGI.png" alt="image.png" />
        </a>
    </div>
</div>
<p>At this point, I use the code:</p><p><code spellcheck="false">mtdata &lt;- mt_align_start_end(mtdata, use = &quot;trajectories&quot;, save_as = &quot;aligned_trajectories&quot;, verbose = FALSE)</code></p><p>and get the warning:</p><p><strong><code spellcheck="false">Warning messages:</code></strong></p><p><strong><code spellcheck="false">1: In mt_align_start_end(mtdata, use = &quot;trajectories&quot;, save_as = &quot;aligned_trajectories&quot;,&nbsp;:</code></strong></p><p><strong><code spellcheck="false">&nbsp;NaN/Inf/-Inf values returned in some trials for the dimension xpos as their start and end coordinate was identical.</code></strong></p><p><strong><code spellcheck="false">2: In mt_align_start_end(mtdata, use = &quot;trajectories&quot;, save_as = &quot;aligned_trajectories&quot;,&nbsp;:</code></strong></p><p><strong><code spellcheck="false">&nbsp;NaN/Inf/-Inf values returned in some trials for the dimension ypos as their start and end coordinate was identical.</code></strong></p><p>Now, generating the plot as above gives me the following warning:</p><p><strong><code spellcheck="false">Warning message:</code></strong></p><p><strong><code spellcheck="false">Removed 22191 row(s) containing missing values (geom_path). </code></strong></p><p>The new plot (i.e., of &quot;aligned&quot; trajectories) looks like this:</p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/917/GN1SJPL0G0J3.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/917/GN1SJPL0G0J3.png" alt="image.png" />
        </a>
    </div>
</div>
<p>Clearly, this does not seem to be the right approach.</p><p>I set out to eliminate weird-looking trajectories manually with <code spellcheck="false">mt_plot_per_trajectory()</code> before attempting to re-align trajectories. I identified over 20 participants whose coordinates look like there have been technical issues. Within the remaining participants, I had to proceed to further remove quite a few trials which were displaying the same issues. My sample size went from n = 85 to n = 59 in this step. Here an example of one good-looking and two not-good-looking trajectories:</p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/521/IP1F3DDI3DBL.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/521/IP1F3DDI3DBL.png" alt="image.png" />
        </a>
    </div>
</div>
<div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/050/C0HMS75N1GFH.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/050/C0HMS75N1GFH.png" alt="image.png" />
        </a>
    </div>
</div>
<p><br /></p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/807/GDKFAOQFR0W9.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/807/GDKFAOQFR0W9.png" alt="image.png" />
        </a>
    </div>
</div>
<p>After this step, I tried to use mt_align_start_end() again, and got the same warnings:</p><p><strong><code spellcheck="false">Warning messages:</code></strong></p><p><strong><code spellcheck="false">1: In mt_align_start_end(mtdata, use = &quot;trajectories&quot;, save_as = &quot;aligned_trajectories&quot;,&nbsp;:</code></strong></p><p><strong><code spellcheck="false">&nbsp;NaN/Inf/-Inf values returned in some trials for the dimension xpos as their start and end coordinate was identical.</code></strong></p><p><strong><code spellcheck="false">2: In mt_align_start_end(mtdata, use = &quot;trajectories&quot;, save_as = &quot;aligned_trajectories&quot;,&nbsp;:</code></strong></p><p><strong><code spellcheck="false">&nbsp;NaN/Inf/-Inf values returned in some trials for the dimension ypos as their start and end coordinate was identical.</code></strong></p><p>Plotting the data gives the same error message (but with fewer &quot;removed rows containing missing values&quot; than before excluding &quot;faulty&quot; trajectories).</p><p>I then had to switch to <code spellcheck="false">mt_align()</code>: </p><p><code spellcheck="false">mtdata&lt;- mt_align(mtdata,use = &quot;trajectories&quot;,save_as = &quot;aligned_trajectories&quot;,verbose = FALSE)</code></p><p>No warnings, and the plot now looks like this:</p><p> </p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/932/BVFF3TOQ6RMH.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/932/BVFF3TOQ6RMH.png" alt="image.png" />
        </a>
    </div>
</div>
<p><br /></p><p>Then I time-normalized the aligned trajectories (now saved simply as &quot;trajectories&quot;, because the &quot;timestamps&quot; variable was absent from the renamed &quot;aligned_trajectories&quot; array):</p><p><code spellcheck="false">mtdata &lt;- mt_time_normalize(mtdata, use= &quot;trajectories&quot;, save_as = &quot;tn_trajectories&quot;)</code></p><p>Now, I would expect time-normalized trajectories to be aligned. However, when I go ahead and plot the data, it looks like the starting points differ substantially between conditions, such that I am led to think that one or more of the previous steps were either wrong or implemented incorrectly.</p><p><code spellcheck="false">mt_plot_aggregate(mtdata, use=&quot;tn_trajectories&quot;,</code></p><p><code spellcheck="false">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x=&quot;xpos&quot;, y=&quot;steps&quot;, color=&quot;condition&quot;,</code></p><p><code spellcheck="false">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subject_id=&quot;Subject&quot;)+</code></p><p><code spellcheck="false">&nbsp;ggplot2::theme_bw()+ ggplot2::coord_flip()</code></p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/238/W717Y69A6TQP.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/238/W717Y69A6TQP.png" alt="image.png" />
        </a>
    </div>
</div>
<p>My questions:</p><ul><li>Could the alignment issues be originating from data preparation steps before importing with mousetrap?</li><li>Are the pre-processing steps (with the mousetrap package) sufficient for analysis, or have I missed anything important? E.g., I am not sure whether the <code spellcheck="false">mt_align()</code> function is also flipping trajectories in such a way that they all end on the same side.</li><li>Do you have any suggestions to &quot;rescue&quot; at least a bit of all the data lost from the exclusion of &quot;faulty&quot; trajectories? Perhaps there are some transformations I could be implementing to solve or avoid similar issues (and if it is a problem with data collection, perhaps I could be avoiding the same mistakes in the future).</li><li>If all of the above seem fine, any suggestions for how to align the starting positions on the graph?</li></ul><p>My next step in the analysis is to run mixed-effects linear regression with xpos as continuous outcome variable. Thank you for reading until here, any help would be greatly appreciated!</p><p>Best,</p><p>Carlotta</p>]]>
        </description>
    </item>
    <item>
        <title>Question regarding importing CSV data into mousetrap (non-standard use)</title>
        <link>https://forum.cogsci.nl/discussion/7852/question-regarding-importing-csv-data-into-mousetrap-non-standard-use</link>
        <pubDate>Sat, 12 Mar 2022 07:40:26 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>avgnr86</dc:creator>
        <guid isPermaLink="false">7852@/discussions</guid>
        <description><![CDATA[<p>Hello all!,</p><p>I&#39;m trying to use mousetrap to process some data that is not strictly speaking mouse movement data. The data I&#39;m trying to analyse is player movements around a map (x,y coordinates of the video game Dota 2). The reason I want to use mousetrap is because I want to use time normalisation. What I have a readings of position changes and not a time series of player positions. Basically, if we take the X-coordinates of player A, the array of values can be shorter or longer than player B. </p><p>Maybe what I&#39;m trying to do is not possible but I&#39;m curious to try. Could someone direct me in how to use the mt_import functions? I&#39;ve coreced the data into looking like the screenshot. </p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/470/51HAQ1F2N6M4.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/470/51HAQ1F2N6M4.png" alt="image.png" />
        </a>
    </div>
</div>
<p>Thank you!</p>]]>
        </description>
    </item>
    <item>
        <title>How to plot my aggregated trajectories using mousetrap in R</title>
        <link>https://forum.cogsci.nl/discussion/7774/how-to-plot-my-aggregated-trajectories-using-mousetrap-in-r</link>
        <pubDate>Mon, 14 Feb 2022 09:26:40 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>TheViuf</dc:creator>
        <guid isPermaLink="false">7774@/discussions</guid>
        <description><![CDATA[<p>Hi everyone :)</p><p>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.  </p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/636/ES8ARA08JAE1.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/636/ES8ARA08JAE1.png" alt="Skærmbillede 2022-02-14 kl. 10.02.14.png" />
        </a>
    </div>
</div>
<p>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:</p><pre spellcheck="false">raw_remapped &lt;- mt_remap_symmetric(
&nbsp;raw_remapped,
&nbsp;use = &quot;tn_trajectories&quot;,
&nbsp;save_as = &quot;tn_trajectories&quot;,
&nbsp;dimensions = c(&quot;xpos&quot;, &quot;ypos&quot;),
&nbsp;remap_xpos = &quot;left&quot;,
&nbsp;remap_ypos = &quot;no&quot;)
</pre><p>But when I apply the mt_plot_aggregate function like this after preprocessing:</p><pre spellcheck="false">mt_plot_aggregate(raw_remapped, use=&quot;tn_trajectories&quot;, color=&quot;condition&quot;) + 
ggtitle(&quot;Aggregated trajectories&quot;) + theme_minimal()
</pre><p>I get this plot:</p><div>
    <div>
        <a href="https://forum.cogsci.nl/uploads/533/3S9UUTY5QSIR.png" rel="nofollow noopener" target="_blank">
            <img src="https://forum.cogsci.nl/uploads/533/3S9UUTY5QSIR.png" alt="Skærmbillede 2022-02-14 kl. 10.05.21.png" />
        </a>
    </div>
</div>
<p>I don&#39;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. </p><p>Please ask questions if this is confusing! I hope you can clear it up for me. </p><p><br /></p><p>Best wishes </p><p>Sara :)</p>]]>
        </description>
    </item>
    <item>
        <title>Amount of time spent on either side of y-axis</title>
        <link>https://forum.cogsci.nl/discussion/7770/amount-of-time-spent-on-either-side-of-y-axis</link>
        <pubDate>Sat, 12 Feb 2022 14:03:27 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>TheViuf</dc:creator>
        <guid isPermaLink="false">7770@/discussions</guid>
        <description><![CDATA[<p>Hi everyone</p><p>Is there a way to measure how much time was spent on the left and the right side of the y-axis using mousetrap? I&#39;m almost done with my analysis, but I haven&#39;t stumbles upon such a measure yet.</p><p>Thanks :)</p><p>-Sara</p>]]>
        </description>
    </item>
    <item>
        <title>Issues Installing Mousetrap</title>
        <link>https://forum.cogsci.nl/discussion/7748/issues-installing-mousetrap</link>
        <pubDate>Thu, 03 Feb 2022 00:51:21 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>tiablackall</dc:creator>
        <guid isPermaLink="false">7748@/discussions</guid>
        <description><![CDATA[<p>Hello! I am having issues installing Mousetrap. I have followed the install instructions while running OpenSesame as administrator. However I get an AttributeError while installing, and when I restart Opensesame the Mousetrap functions are not there. I am attaching an image of the installation and the error below.</p><a rel="nofollow" href="https://lh6.googleusercontent.com/hHnKHaVoN-UVEa9BK6_Bd-ezOYf6umW-sYSVR_fGiEvU3CVmsaw-xQdGdl1g93gKAQ0ACnlTw-4ANhSXsk_mO5A3tNkAwlYp00cHIMt1y6GVb26Bj5nJOdHc7he9Ft9xWmgYIWZD" data-embedjson="{&quot;embedType&quot;:&quot;image&quot;,&quot;url&quot;:&quot;https:\/\/lh6.googleusercontent.com\/hHnKHaVoN-UVEa9BK6_Bd-ezOYf6umW-sYSVR_fGiEvU3CVmsaw-xQdGdl1g93gKAQ0ACnlTw-4ANhSXsk_mO5A3tNkAwlYp00cHIMt1y6GVb26Bj5nJOdHc7he9Ft9xWmgYIWZD&quot;,&quot;name&quot;:&quot;Mousetrap error].png&quot;,&quot;attributes&quot;:[],&quot;format&quot;:null,&quot;bodyRaw&quot;:null}">
    https://lh6.googleusercontent.com/hHnKHaVoN-UVEa9BK6_Bd-ezOYf6umW-sYSVR_fGiEvU3CVmsaw-xQdGdl1g93gKAQ0ACnlTw-4ANhSXsk_mO5A3tNkAwlYp00cHIMt1y6GVb26Bj5nJOdHc7he9Ft9xWmgYIWZD
    
        There was an error displaying this embed.
        
        
        
    
</a>
<p>Since this was not working I also tried to manually install it by downloading the folder from this site.<a href="https://github.com/PascalKieslich/mousetrap-os/releases/tag/2.0.0" rel="nofollow"> https://github.com/PascalKieslich/mousetrap-os/releases/tag/2.0.0</a></p><p>I put the folder in &#39;&#39;C:\Program Files (x86)\OpenSesame\share\opensesame_plugins&#39;&#39; which is where the OpenSesame resource<a href="https://osdoc.cogsci.nl/3.2/manual/environment/#:~:text=To%20manually%20install%20a%20plugin,system%20and%20distribution%20of%20OpenSesame." rel="nofollow"> https://osdoc.cogsci.nl/3.2/manual/environment/#:~:text=To%20manually%20install%20a%20plugin,system%20and%20distribution%20of%20OpenSesame.</a> told me to put it. However, OpenSesame does not seem to recognize the Mousetrap folder. Any help would be greatly appreciated!</p><p>Just in case it is needed I am running OpenSesame 3.2.8.</p>]]>
        </description>
    </item>
    <item>
        <title>Question about mouse-tracking measures</title>
        <link>https://forum.cogsci.nl/discussion/6370/question-about-mouse-tracking-measures</link>
        <pubDate>Thu, 06 Aug 2020 21:46:57 +0000</pubDate>
        <category>Mousetrap</category>
        <dc:creator>GoSugar</dc:creator>
        <guid isPermaLink="false">6370@/discussions</guid>
        <description><![CDATA[<p>Hello!🤠</p><p>I prepared an experiment in OpenSesame and I obtained mouse-tracking measures in R. I compared 3 cases. While there seems to be a significant difference in terms of AUC among 3 different cases (this is our expectation), no significant difference occurs in terms of MAD values among 3 cases. Is this normal? Is something wrong with my data? Do I also have to obtain a difference in terms of MAD values? Which measure do I need to take into consideration? Is it okay if I just take AUC? </p><p><br /></p><p>Thank you 🤠</p>]]>
        </description>
    </item>
   </channel>
</rss>
