﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 6  » Calculating RT percentiles as cutoff scores</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Tue, 29 Sep 2026 14:17:44 GMT</lastBuildDate><ttl>20</ttl><item><title>Calculating RT percentiles as cutoff scores</title><link>https://forums.millisecond.com/Topic31756.aspx</link><description>Hello, &lt;br/&gt;&lt;br/&gt;My coding knowledge is rather rudimentary, so I would appreciate any help with the following questions. &lt;br/&gt;&lt;br/&gt;I was wondering if it is possible to calculate the fastest 30th percentile of correct reaction times from a baseline block, and use this new reaction time value as the cut-off reaction time in the next block? Specifically, I’m hoping to use the RT from the correct responses in my “No Reward” trials/blocks, calculate the fastest 30th percentile value, and incorporate this value as cut-off&amp;nbsp; RT for the trials in my following “Reward” incentive block for each participant.&lt;br/&gt;&lt;br/&gt;In addition, is there a way to  manipulate/have two different feedback messages dependent on the participant’s response? Specifically, is there a way to set it up so that if they reply accurately but slower than the RT cutoff (as determined above in the previous “No Reward” block) they receive a “Trial Over” feedback message, but if they respond incorrectly they receive an “Error” message? I currently have it set up as messages for incorrect message and correct message, but was wondering if there would be a way to make this conditional.  In line with this, is there a way to change the feedback message for the correct response to also be based on the precue shown in the trial? &lt;br/&gt;&lt;br/&gt;I have attached my script for details. Thank you so much in advance!&lt;br/&gt;</description><pubDate>Mon, 28 Jun 2021 21:39:53 GMT</pubDate><dc:creator>ivy.c</dc:creator></item><item><title>RE: Calculating RT percentiles as cutoff scores</title><link>https://forums.millisecond.com/Topic31782.aspx</link><description>&lt;blockquote data-id="31781" class="if-quote-wrapper" unselectable="on" data-guid="1624916319335" id="if_insertedNode_1624916317653" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31781" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31781" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31781" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/28/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31781"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31780" class="if-quote-wrapper" unselectable="on" data-guid="1624916319335" id="if_insertedNode_1624914257510" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31780" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31780" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31780" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/28/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31780"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31779" class="if-quote-wrapper" unselectable="on" data-guid="1624916319335" id="if_insertedNode_1624911607332" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31779" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31779" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31779" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/28/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31779"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31760" class="if-quote-wrapper" unselectable="on" data-guid="1624916319335" id="if_insertedNode_1624910668049" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31760" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31760" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31760" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/25/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31760"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31759" class="if-quote-wrapper" unselectable="on" data-guid="1624916319335" id="if_insertedNode_1624620363254" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31759" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31759" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31759" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/25/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31759"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31757" class="if-quote-wrapper" unselectable="on" data-guid="1624916319335" id="if_insertedNode_1624587356754" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31757" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31757" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31757" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31757"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31756" class="if-quote-wrapper" unselectable="on" data-guid="1624916319335" id="if_insertedNode_1624567836148" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31756" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31756" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31756" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31756"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello, &lt;br/&gt;&lt;br/&gt;My coding knowledge is rather rudimentary, so I would appreciate any help with the following questions. &lt;br/&gt;&lt;br/&gt;I was wondering if it is possible to calculate the fastest 30th percentile of correct reaction times from a baseline block, and use this new reaction time value as the cut-off reaction time in the next block? Specifically, I’m hoping to use the RT from the correct responses in my “No Reward” trials/blocks, calculate the fastest 30th percentile value, and incorporate this value as cut-off&amp;nbsp; RT for the trials in my following “Reward” incentive block for each participant.&lt;br/&gt;&lt;br/&gt;In addition, is there a way to  manipulate/have two different feedback messages dependent on the participant’s response? Specifically, is there a way to set it up so that if they reply accurately but slower than the RT cutoff (as determined above in the previous “No Reward” block) they receive a “Trial Over” feedback message, but if they respond incorrectly they receive an “Error” message? I currently have it set up as messages for incorrect message and correct message, but was wondering if there would be a way to make this conditional.  In line with this, is there a way to change the feedback message for the correct response to also be based on the precue shown in the trial? &lt;br/&gt;&lt;br/&gt;I have attached my script for details. Thank you so much in advance!&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31756"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Re. 1), &lt;br/&gt;-&amp;nbsp; put the relevant RTs in a &amp;lt;list&amp;gt; at runtime &lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- sort the list at the end of the baseline block&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- then retrieve nth value from the list correponding to the 30th percentile as your cut-off and store it in a value&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Re. 2), yes, you can /branch to different feedback trials based on whether the response latency is slower than the cut-off value, etc.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31757"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thank you for your reply. Could you provide a bit more clarification regarding the step about retrieving the nth value and storing it as a value? Am I creating a separate item from the list I've sorted at the end of the block? I'm just a little unclear how to adapt the code based on the link you provided.&lt;br/&gt;&lt;br/&gt;Thank you in advance! &lt;a class="if-quote-goto quote-link" href="#" data-id="31759"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You already have a list containing the correct RTs. So then you sort it in ascending order at the end of the block, calculate the index -- 0.3 * the list's itemcount, rounded to the nearest whole number -- and retrieve the item at that index*:&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;block shortnoreward_final&amp;gt;&lt;br/&gt;/ onblockend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sort correct RTs in ascending order&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT.sort(true, false);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// calculate index&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.index = round(0.3 * list.corrRT.itemcount);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// get 30th percentile from list&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.cutoff_RT = list.corrRT.item(values.index);&lt;br/&gt;]&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_No,AX_Short_No,AX_Short_No,AX_Short_No,BX_Short_No,AY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No)]&lt;br/&gt;&amp;lt;/block&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;*There's no universal definition of percentile. In some definitions the index value is taken as the percentile value. In others, it's value after that in the sorted data set, in again others, the percentile value is taken as the average of those two values, so adjust the calculatin according to your preferences.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31760"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thank you so much! That makes sense. I also took your feedback and used the branch attribute to give specific feedback based on the response time or the participant’s answer. However, I have run into the following problems:&lt;br/&gt;&lt;br/&gt;1. In addition to having the branch be conditional based on whether the participant is correct/incorrect/responds in time, I’m hoping to set it up so that the feedback presented to the participant is dependent on the “precue” that is presented  on that trial. Specifically, I have it set up where the “precue” is either the “$” or “■” (and then this is stored as a value). Is there a way to set it up so that if the participant answers correctly when they are presented with a “$” value, they are given the feedback in the trial “correctfb” but if they are correct and presented with a “■” they are given a different feedback message (i.e., trial “correct_norewardfb”)?  Based on looking online, I believe I have to use&amp;nbsp; “&amp;amp;&amp;amp;”, but I’m not entirely sure. (Script below):&lt;br/&gt;&lt;br/&gt;&amp;lt;trial AX_Short_Reward&amp;gt;&lt;br/&gt;/ inputdevice = keyboard&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.precue = list.precue.nextvalue;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.cue = "A";&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.probe = "X";&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(shape.eraser, expressions.precueeraser);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.cue, expressions.cue);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.fixation, expressions.shortdelay);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.probe, expressions.probe_short);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;/ stimulustimes = [0 = precue]&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.countcorrect += trial.AX_Short_Reward.correct;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.countcorrect_AX_Short_Reward += trial.AX_Short_Reward.correct;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_AX.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_AX_Short_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Short_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Short.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (trial.AX_Short_Reward.correct){&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_AX.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_AX_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Short.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_AX.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_AX_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Short.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;]&lt;br/&gt;/ correctresponse = ("E")&lt;br/&gt;/ validresponse = ("E", "I")&lt;br/&gt;/ beginresponsetime = 1800&lt;br/&gt;/ timeout = 1800+values.cutoff_RT&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.response==0)trial.tooslowfb]&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.error)trial.errorfb]&lt;br/&gt;/branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.correct)trial.correctfb]&lt;br/&gt;/ posttrialpause = parameters.iti&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial correctfb&amp;gt;&lt;br/&gt;/stimulustimes = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0=correctstim&lt;br/&gt;]&lt;br/&gt;/ validresponse = (0)&lt;br/&gt;/ timeout = 1000&lt;br/&gt;/ posttrialpause = 250&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial correct_norewardfb&amp;gt;&lt;br/&gt;/stimulustimes = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0=correct_norewardstim&lt;br/&gt;]&lt;br/&gt;/validresponse = (0)&lt;br/&gt;/timeout = 1000&lt;br/&gt;/ posttrialpause = 250&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;2. I also created another set of blocks (“longnoreward_final” and “longreward_final”), where I hope to incorporate the same feature where the RT cut-off for the trials in “longreward_final” is the 30th percentile of the RTs from the baseline block (“longnoreward_final”). However, when I run it as the next set of blocks, the value does not seem to be properly updated, and seems to store the value used in block 2 (“shortreard_final”). Is there a way to reset/change this value? Or would I have to create a separate value to be used in block 4 (longreward_final) based on the values from block 3 (longnoreward_final)? (Script below):&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;block shortnoreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (intronoreward)&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_No,AX_Short_No,AX_Short_No,AX_Short_No,BX_Short_No,AY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No)]&lt;br/&gt;/ onblockend = [list.corrRT_baseline_short.sort(false,false);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;values.index = round(0.3*list.corrRT_baseline_short.itemcount);&lt;br/&gt;values.cutoff_RT = list.corrRT_baseline_short.item(values.index);&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block shortreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (introreward)&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_Reward,AX_Short_Reward,AX_Short_Reward,AX_Short_Reward,BX_Short_Reward, AY_Short_Reward,BY_Short_Reward,BY_Short_Reward,BY_Short_Reward,BY_Short_Reward)]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block longnoreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (intronoreward)&lt;br/&gt;/trials = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1-10 = noreplace(AX_Long_No,AX_Long_No,AX_Long_No,AX_Long_No,BX_Long_No, AY_Long_No, BY_Long_No, BY_Long_No, BY_Long_No,BY_Long_No,)&lt;br/&gt;]&lt;br/&gt;/ onblockend = [list.corrRT_baseline_long.sort(false,false);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;values.index = round(0.3*list.corrRT_baseline_long.itemcount);&lt;br/&gt;values.cutoff_RT = list.corrRT_baseline_long.item(values.index);&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block longreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (introreward)&lt;br/&gt;/trials = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1-10 =noreplace(AX_Long_Reward,AX_Long_Reward,AX_Long_Reward,AX_Long_Reward,BX_Long_Reward, AY_Long_Reward, BY_Long_Reward, BY_Long_Reward, BY_Long_Reward, BY_Long_Reward)&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thank you so much in advance!&lt;a class="if-quote-goto quote-link" href="#" data-id="31779"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;&amp;gt; Specifically, I have it set up where the “precue” is either the “$” or “■” (and then this is stored as a value). Is there a way to set it up so that if the participant answers correctly when they are presented with a “$” value, they are given the feedback in the trial “correctfb” but if they are correct and presented with a “■” they are given a different feedback message (i.e., trial “correct_norewardfb”)? Based on looking online, I believe I have to use  “&amp;amp;&amp;amp;”&lt;br/&gt;&lt;br/&gt;Well, yes. You have the precue in values.precue and you need to fashon branch conditions with a logical and (&amp;amp;&amp;amp;) accordingly.&lt;br/&gt;&lt;br/&gt;Question 2 is not answerable based on the few code snippets. Are you actually populating list.corrRT_baseline_long with any latencies at all?&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31780"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thanks for your response. &lt;br/&gt;&lt;br/&gt;re.#1) I've been having a bit of a difficult time figuring out what the correct code is for this branch. I believe I understand that I have both the condition for when the trial is correct and the precue value, but am unsure how to specify the precue value correctly (code below)&lt;br/&gt;&lt;br/&gt;/branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Long_Reward.correct &amp;amp;&amp;amp; values.precue(?))trial.correctfb]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;re. #2) Yes, I am populating the list.corrRT_baseline_long with latencies&amp;nbsp;from the trials in my “longnoreward_final” block. I have it set up as the same format as my previous trials/blocks (1&amp;amp;2), just named differently.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Thank you so much!&lt;a class="if-quote-goto quote-link" href="#" data-id="31781"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;/branch = [&lt;br/&gt;&amp;nbsp; if(trial.AX_Long_Reward.correct &amp;amp;&amp;amp; values.precue == "whatever the appropriate precue value here is")trial.correctfb]&lt;br/&gt;&lt;br/&gt;Re. 2), again, not answerable without the actual code.</description><pubDate>Mon, 28 Jun 2021 21:39:53 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Calculating RT percentiles as cutoff scores</title><link>https://forums.millisecond.com/Topic31781.aspx</link><description>&lt;blockquote data-id="31780" class="if-quote-wrapper" unselectable="on" data-guid="1624914258651" contenteditable="false" id="if_insertedNode_1624914257510"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31780" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31780" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31780" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/28/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31780"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31779" class="if-quote-wrapper" unselectable="on" data-guid="1624914258651" id="if_insertedNode_1624911607332" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31779" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31779" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31779" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/28/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31779"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31760" class="if-quote-wrapper" unselectable="on" data-guid="1624914258651" id="if_insertedNode_1624910668049" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31760" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31760" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31760" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/25/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31760"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31759" class="if-quote-wrapper" unselectable="on" data-guid="1624914258651" id="if_insertedNode_1624620363254" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31759" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31759" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31759" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/25/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31759"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31757" class="if-quote-wrapper" unselectable="on" data-guid="1624914258651" id="if_insertedNode_1624587356754" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31757" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31757" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31757" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31757"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31756" class="if-quote-wrapper" unselectable="on" data-guid="1624914258651" id="if_insertedNode_1624567836148" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31756" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31756" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31756" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31756"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello, &lt;br/&gt;&lt;br/&gt;My coding knowledge is rather rudimentary, so I would appreciate any help with the following questions. &lt;br/&gt;&lt;br/&gt;I was wondering if it is possible to calculate the fastest 30th percentile of correct reaction times from a baseline block, and use this new reaction time value as the cut-off reaction time in the next block? Specifically, I’m hoping to use the RT from the correct responses in my “No Reward” trials/blocks, calculate the fastest 30th percentile value, and incorporate this value as cut-off&amp;nbsp; RT for the trials in my following “Reward” incentive block for each participant.&lt;br/&gt;&lt;br/&gt;In addition, is there a way to  manipulate/have two different feedback messages dependent on the participant’s response? Specifically, is there a way to set it up so that if they reply accurately but slower than the RT cutoff (as determined above in the previous “No Reward” block) they receive a “Trial Over” feedback message, but if they respond incorrectly they receive an “Error” message? I currently have it set up as messages for incorrect message and correct message, but was wondering if there would be a way to make this conditional.  In line with this, is there a way to change the feedback message for the correct response to also be based on the precue shown in the trial? &lt;br/&gt;&lt;br/&gt;I have attached my script for details. Thank you so much in advance!&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31756"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Re. 1), &lt;br/&gt;-&amp;nbsp; put the relevant RTs in a &amp;lt;list&amp;gt; at runtime &lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- sort the list at the end of the baseline block&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- then retrieve nth value from the list correponding to the 30th percentile as your cut-off and store it in a value&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Re. 2), yes, you can /branch to different feedback trials based on whether the response latency is slower than the cut-off value, etc.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31757"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thank you for your reply. Could you provide a bit more clarification regarding the step about retrieving the nth value and storing it as a value? Am I creating a separate item from the list I've sorted at the end of the block? I'm just a little unclear how to adapt the code based on the link you provided.&lt;br/&gt;&lt;br/&gt;Thank you in advance! &lt;a class="if-quote-goto quote-link" href="#" data-id="31759"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You already have a list containing the correct RTs. So then you sort it in ascending order at the end of the block, calculate the index -- 0.3 * the list's itemcount, rounded to the nearest whole number -- and retrieve the item at that index*:&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;block shortnoreward_final&amp;gt;&lt;br/&gt;/ onblockend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sort correct RTs in ascending order&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT.sort(true, false);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// calculate index&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.index = round(0.3 * list.corrRT.itemcount);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// get 30th percentile from list&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.cutoff_RT = list.corrRT.item(values.index);&lt;br/&gt;]&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_No,AX_Short_No,AX_Short_No,AX_Short_No,BX_Short_No,AY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No)]&lt;br/&gt;&amp;lt;/block&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;*There's no universal definition of percentile. In some definitions the index value is taken as the percentile value. In others, it's value after that in the sorted data set, in again others, the percentile value is taken as the average of those two values, so adjust the calculatin according to your preferences.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31760"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thank you so much! That makes sense. I also took your feedback and used the branch attribute to give specific feedback based on the response time or the participant’s answer. However, I have run into the following problems:&lt;br/&gt;&lt;br/&gt;1. In addition to having the branch be conditional based on whether the participant is correct/incorrect/responds in time, I’m hoping to set it up so that the feedback presented to the participant is dependent on the “precue” that is presented  on that trial. Specifically, I have it set up where the “precue” is either the “$” or “■” (and then this is stored as a value). Is there a way to set it up so that if the participant answers correctly when they are presented with a “$” value, they are given the feedback in the trial “correctfb” but if they are correct and presented with a “■” they are given a different feedback message (i.e., trial “correct_norewardfb”)?  Based on looking online, I believe I have to use&amp;nbsp; “&amp;amp;&amp;amp;”, but I’m not entirely sure. (Script below):&lt;br/&gt;&lt;br/&gt;&amp;lt;trial AX_Short_Reward&amp;gt;&lt;br/&gt;/ inputdevice = keyboard&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.precue = list.precue.nextvalue;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.cue = "A";&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.probe = "X";&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(shape.eraser, expressions.precueeraser);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.cue, expressions.cue);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.fixation, expressions.shortdelay);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.probe, expressions.probe_short);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;/ stimulustimes = [0 = precue]&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.countcorrect += trial.AX_Short_Reward.correct;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.countcorrect_AX_Short_Reward += trial.AX_Short_Reward.correct;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_AX.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_AX_Short_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Short_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Short.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (trial.AX_Short_Reward.correct){&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_AX.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_AX_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Short.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_AX.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_AX_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Short.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;]&lt;br/&gt;/ correctresponse = ("E")&lt;br/&gt;/ validresponse = ("E", "I")&lt;br/&gt;/ beginresponsetime = 1800&lt;br/&gt;/ timeout = 1800+values.cutoff_RT&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.response==0)trial.tooslowfb]&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.error)trial.errorfb]&lt;br/&gt;/branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.correct)trial.correctfb]&lt;br/&gt;/ posttrialpause = parameters.iti&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial correctfb&amp;gt;&lt;br/&gt;/stimulustimes = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0=correctstim&lt;br/&gt;]&lt;br/&gt;/ validresponse = (0)&lt;br/&gt;/ timeout = 1000&lt;br/&gt;/ posttrialpause = 250&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial correct_norewardfb&amp;gt;&lt;br/&gt;/stimulustimes = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0=correct_norewardstim&lt;br/&gt;]&lt;br/&gt;/validresponse = (0)&lt;br/&gt;/timeout = 1000&lt;br/&gt;/ posttrialpause = 250&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;2. I also created another set of blocks (“longnoreward_final” and “longreward_final”), where I hope to incorporate the same feature where the RT cut-off for the trials in “longreward_final” is the 30th percentile of the RTs from the baseline block (“longnoreward_final”). However, when I run it as the next set of blocks, the value does not seem to be properly updated, and seems to store the value used in block 2 (“shortreard_final”). Is there a way to reset/change this value? Or would I have to create a separate value to be used in block 4 (longreward_final) based on the values from block 3 (longnoreward_final)? (Script below):&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;block shortnoreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (intronoreward)&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_No,AX_Short_No,AX_Short_No,AX_Short_No,BX_Short_No,AY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No)]&lt;br/&gt;/ onblockend = [list.corrRT_baseline_short.sort(false,false);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;values.index = round(0.3*list.corrRT_baseline_short.itemcount);&lt;br/&gt;values.cutoff_RT = list.corrRT_baseline_short.item(values.index);&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block shortreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (introreward)&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_Reward,AX_Short_Reward,AX_Short_Reward,AX_Short_Reward,BX_Short_Reward, AY_Short_Reward,BY_Short_Reward,BY_Short_Reward,BY_Short_Reward,BY_Short_Reward)]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block longnoreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (intronoreward)&lt;br/&gt;/trials = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1-10 = noreplace(AX_Long_No,AX_Long_No,AX_Long_No,AX_Long_No,BX_Long_No, AY_Long_No, BY_Long_No, BY_Long_No, BY_Long_No,BY_Long_No,)&lt;br/&gt;]&lt;br/&gt;/ onblockend = [list.corrRT_baseline_long.sort(false,false);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;values.index = round(0.3*list.corrRT_baseline_long.itemcount);&lt;br/&gt;values.cutoff_RT = list.corrRT_baseline_long.item(values.index);&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block longreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (introreward)&lt;br/&gt;/trials = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1-10 =noreplace(AX_Long_Reward,AX_Long_Reward,AX_Long_Reward,AX_Long_Reward,BX_Long_Reward, AY_Long_Reward, BY_Long_Reward, BY_Long_Reward, BY_Long_Reward, BY_Long_Reward)&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thank you so much in advance!&lt;a class="if-quote-goto quote-link" href="#" data-id="31779"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;&amp;gt; Specifically, I have it set up where the “precue” is either the “$” or “■” (and then this is stored as a value). Is there a way to set it up so that if the participant answers correctly when they are presented with a “$” value, they are given the feedback in the trial “correctfb” but if they are correct and presented with a “■” they are given a different feedback message (i.e., trial “correct_norewardfb”)? Based on looking online, I believe I have to use  “&amp;amp;&amp;amp;”&lt;br/&gt;&lt;br/&gt;Well, yes. You have the precue in values.precue and you need to fashon branch conditions with a logical and (&amp;amp;&amp;amp;) accordingly.&lt;br/&gt;&lt;br/&gt;Question 2 is not answerable based on the few code snippets. Are you actually populating list.corrRT_baseline_long with any latencies at all?&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31780"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thanks for your response. &lt;br/&gt;&lt;br/&gt;re.#1) I've been having a bit of a difficult time figuring out what the correct code is for this branch. I believe I understand that I have both the condition for when the trial is correct and the precue value, but am unsure how to specify the precue value correctly (code below)&lt;br/&gt;&lt;br/&gt;/branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Long_Reward.correct &amp;amp;&amp;amp; values.precue(?))trial.correctfb]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;re. #2) Yes, I am populating the list.corrRT_baseline_long with latencies&amp;nbsp;from the trials in my “longnoreward_final” block. I have it set up as the same format as my previous trials/blocks (1&amp;amp;2), just named differently.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Thank you so much!</description><pubDate>Mon, 28 Jun 2021 21:12:43 GMT</pubDate><dc:creator>ivy.c</dc:creator></item><item><title>RE: Calculating RT percentiles as cutoff scores</title><link>https://forums.millisecond.com/Topic31780.aspx</link><description>&lt;blockquote data-id="31779" class="if-quote-wrapper" unselectable="on" data-guid="1624911608907" id="if_insertedNode_1624911607332" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31779" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31779" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31779" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/28/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31779"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31760" class="if-quote-wrapper" unselectable="on" data-guid="1624911608907" id="if_insertedNode_1624910668049" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31760" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31760" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31760" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/25/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31760"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31759" class="if-quote-wrapper" unselectable="on" data-guid="1624911608907" id="if_insertedNode_1624620363254" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31759" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31759" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31759" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/25/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31759"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31757" class="if-quote-wrapper" unselectable="on" data-guid="1624911608907" id="if_insertedNode_1624587356754" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31757" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31757" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31757" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31757"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31756" class="if-quote-wrapper" unselectable="on" data-guid="1624911608907" id="if_insertedNode_1624567836148" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31756" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31756" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31756" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31756"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello, &lt;br/&gt;&lt;br/&gt;My coding knowledge is rather rudimentary, so I would appreciate any help with the following questions. &lt;br/&gt;&lt;br/&gt;I was wondering if it is possible to calculate the fastest 30th percentile of correct reaction times from a baseline block, and use this new reaction time value as the cut-off reaction time in the next block? Specifically, I’m hoping to use the RT from the correct responses in my “No Reward” trials/blocks, calculate the fastest 30th percentile value, and incorporate this value as cut-off&amp;nbsp; RT for the trials in my following “Reward” incentive block for each participant.&lt;br/&gt;&lt;br/&gt;In addition, is there a way to  manipulate/have two different feedback messages dependent on the participant’s response? Specifically, is there a way to set it up so that if they reply accurately but slower than the RT cutoff (as determined above in the previous “No Reward” block) they receive a “Trial Over” feedback message, but if they respond incorrectly they receive an “Error” message? I currently have it set up as messages for incorrect message and correct message, but was wondering if there would be a way to make this conditional.  In line with this, is there a way to change the feedback message for the correct response to also be based on the precue shown in the trial? &lt;br/&gt;&lt;br/&gt;I have attached my script for details. Thank you so much in advance!&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31756"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Re. 1), &lt;br/&gt;-&amp;nbsp; put the relevant RTs in a &amp;lt;list&amp;gt; at runtime &lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- sort the list at the end of the baseline block&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- then retrieve nth value from the list correponding to the 30th percentile as your cut-off and store it in a value&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Re. 2), yes, you can /branch to different feedback trials based on whether the response latency is slower than the cut-off value, etc.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31757"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thank you for your reply. Could you provide a bit more clarification regarding the step about retrieving the nth value and storing it as a value? Am I creating a separate item from the list I've sorted at the end of the block? I'm just a little unclear how to adapt the code based on the link you provided.&lt;br/&gt;&lt;br/&gt;Thank you in advance! &lt;a class="if-quote-goto quote-link" href="#" data-id="31759"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You already have a list containing the correct RTs. So then you sort it in ascending order at the end of the block, calculate the index -- 0.3 * the list's itemcount, rounded to the nearest whole number -- and retrieve the item at that index*:&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;block shortnoreward_final&amp;gt;&lt;br/&gt;/ onblockend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sort correct RTs in ascending order&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT.sort(true, false);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// calculate index&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.index = round(0.3 * list.corrRT.itemcount);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// get 30th percentile from list&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.cutoff_RT = list.corrRT.item(values.index);&lt;br/&gt;]&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_No,AX_Short_No,AX_Short_No,AX_Short_No,BX_Short_No,AY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No)]&lt;br/&gt;&amp;lt;/block&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;*There's no universal definition of percentile. In some definitions the index value is taken as the percentile value. In others, it's value after that in the sorted data set, in again others, the percentile value is taken as the average of those two values, so adjust the calculatin according to your preferences.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31760"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thank you so much! That makes sense. I also took your feedback and used the branch attribute to give specific feedback based on the response time or the participant’s answer. However, I have run into the following problems:&lt;br/&gt;&lt;br/&gt;1. In addition to having the branch be conditional based on whether the participant is correct/incorrect/responds in time, I’m hoping to set it up so that the feedback presented to the participant is dependent on the “precue” that is presented  on that trial. Specifically, I have it set up where the “precue” is either the “$” or “■” (and then this is stored as a value). Is there a way to set it up so that if the participant answers correctly when they are presented with a “$” value, they are given the feedback in the trial “correctfb” but if they are correct and presented with a “■” they are given a different feedback message (i.e., trial “correct_norewardfb”)?  Based on looking online, I believe I have to use&amp;nbsp; “&amp;amp;&amp;amp;”, but I’m not entirely sure. (Script below):&lt;br/&gt;&lt;br/&gt;&amp;lt;trial AX_Short_Reward&amp;gt;&lt;br/&gt;/ inputdevice = keyboard&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.precue = list.precue.nextvalue;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.cue = "A";&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.probe = "X";&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(shape.eraser, expressions.precueeraser);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.cue, expressions.cue);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.fixation, expressions.shortdelay);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.probe, expressions.probe_short);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;/ stimulustimes = [0 = precue]&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.countcorrect += trial.AX_Short_Reward.correct;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.countcorrect_AX_Short_Reward += trial.AX_Short_Reward.correct;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_AX.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_AX_Short_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Short_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Short.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (trial.AX_Short_Reward.correct){&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_AX.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_AX_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Short.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_AX.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_AX_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Short.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;]&lt;br/&gt;/ correctresponse = ("E")&lt;br/&gt;/ validresponse = ("E", "I")&lt;br/&gt;/ beginresponsetime = 1800&lt;br/&gt;/ timeout = 1800+values.cutoff_RT&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.response==0)trial.tooslowfb]&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.error)trial.errorfb]&lt;br/&gt;/branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.correct)trial.correctfb]&lt;br/&gt;/ posttrialpause = parameters.iti&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial correctfb&amp;gt;&lt;br/&gt;/stimulustimes = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0=correctstim&lt;br/&gt;]&lt;br/&gt;/ validresponse = (0)&lt;br/&gt;/ timeout = 1000&lt;br/&gt;/ posttrialpause = 250&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial correct_norewardfb&amp;gt;&lt;br/&gt;/stimulustimes = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0=correct_norewardstim&lt;br/&gt;]&lt;br/&gt;/validresponse = (0)&lt;br/&gt;/timeout = 1000&lt;br/&gt;/ posttrialpause = 250&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;2. I also created another set of blocks (“longnoreward_final” and “longreward_final”), where I hope to incorporate the same feature where the RT cut-off for the trials in “longreward_final” is the 30th percentile of the RTs from the baseline block (“longnoreward_final”). However, when I run it as the next set of blocks, the value does not seem to be properly updated, and seems to store the value used in block 2 (“shortreard_final”). Is there a way to reset/change this value? Or would I have to create a separate value to be used in block 4 (longreward_final) based on the values from block 3 (longnoreward_final)? (Script below):&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;block shortnoreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (intronoreward)&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_No,AX_Short_No,AX_Short_No,AX_Short_No,BX_Short_No,AY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No)]&lt;br/&gt;/ onblockend = [list.corrRT_baseline_short.sort(false,false);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;values.index = round(0.3*list.corrRT_baseline_short.itemcount);&lt;br/&gt;values.cutoff_RT = list.corrRT_baseline_short.item(values.index);&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block shortreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (introreward)&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_Reward,AX_Short_Reward,AX_Short_Reward,AX_Short_Reward,BX_Short_Reward, AY_Short_Reward,BY_Short_Reward,BY_Short_Reward,BY_Short_Reward,BY_Short_Reward)]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block longnoreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (intronoreward)&lt;br/&gt;/trials = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1-10 = noreplace(AX_Long_No,AX_Long_No,AX_Long_No,AX_Long_No,BX_Long_No, AY_Long_No, BY_Long_No, BY_Long_No, BY_Long_No,BY_Long_No,)&lt;br/&gt;]&lt;br/&gt;/ onblockend = [list.corrRT_baseline_long.sort(false,false);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;values.index = round(0.3*list.corrRT_baseline_long.itemcount);&lt;br/&gt;values.cutoff_RT = list.corrRT_baseline_long.item(values.index);&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block longreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (introreward)&lt;br/&gt;/trials = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1-10 =noreplace(AX_Long_Reward,AX_Long_Reward,AX_Long_Reward,AX_Long_Reward,BX_Long_Reward, AY_Long_Reward, BY_Long_Reward, BY_Long_Reward, BY_Long_Reward, BY_Long_Reward)&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thank you so much in advance!&lt;a class="if-quote-goto quote-link" href="#" data-id="31779"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;&amp;gt; Specifically, I have it set up where the “precue” is either the “$” or “■” (and then this is stored as a value). Is there a way to set it up so that if the participant answers correctly when they are presented with a “$” value, they are given the feedback in the trial “correctfb” but if they are correct and presented with a “■” they are given a different feedback message (i.e., trial “correct_norewardfb”)? Based on looking online, I believe I have to use  “&amp;amp;&amp;amp;”&lt;br/&gt;&lt;br/&gt;Well, yes. You have the precue in values.precue and you need to fashon branch conditions with a logical and (&amp;amp;&amp;amp;) accordingly.&lt;br/&gt;&lt;br/&gt;Question 2 is not answerable based on the few code snippets. Are you actually populating list.corrRT_baseline_long with any latencies at all?&lt;br/&gt;</description><pubDate>Mon, 28 Jun 2021 20:23:23 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Calculating RT percentiles as cutoff scores</title><link>https://forums.millisecond.com/Topic31779.aspx</link><description>&lt;blockquote data-id="31760" class="if-quote-wrapper" unselectable="on" data-guid="1624910669419" contenteditable="false" id="if_insertedNode_1624910668049"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31760" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31760" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31760" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/25/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31760"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31759" class="if-quote-wrapper" unselectable="on" data-guid="1624910669419" id="if_insertedNode_1624620363254" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31759" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31759" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31759" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/25/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31759"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31757" class="if-quote-wrapper" unselectable="on" data-guid="1624910669419" id="if_insertedNode_1624587356754" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31757" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31757" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31757" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31757"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31756" class="if-quote-wrapper" unselectable="on" data-guid="1624910669419" id="if_insertedNode_1624567836148" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31756" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31756" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31756" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31756"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello, &lt;br/&gt;&lt;br/&gt;My coding knowledge is rather rudimentary, so I would appreciate any help with the following questions. &lt;br/&gt;&lt;br/&gt;I was wondering if it is possible to calculate the fastest 30th percentile of correct reaction times from a baseline block, and use this new reaction time value as the cut-off reaction time in the next block? Specifically, I’m hoping to use the RT from the correct responses in my “No Reward” trials/blocks, calculate the fastest 30th percentile value, and incorporate this value as cut-off&amp;nbsp; RT for the trials in my following “Reward” incentive block for each participant.&lt;br/&gt;&lt;br/&gt;In addition, is there a way to  manipulate/have two different feedback messages dependent on the participant’s response? Specifically, is there a way to set it up so that if they reply accurately but slower than the RT cutoff (as determined above in the previous “No Reward” block) they receive a “Trial Over” feedback message, but if they respond incorrectly they receive an “Error” message? I currently have it set up as messages for incorrect message and correct message, but was wondering if there would be a way to make this conditional.  In line with this, is there a way to change the feedback message for the correct response to also be based on the precue shown in the trial? &lt;br/&gt;&lt;br/&gt;I have attached my script for details. Thank you so much in advance!&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31756"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Re. 1), &lt;br/&gt;-&amp;nbsp; put the relevant RTs in a &amp;lt;list&amp;gt; at runtime &lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- sort the list at the end of the baseline block&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- then retrieve nth value from the list correponding to the 30th percentile as your cut-off and store it in a value&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Re. 2), yes, you can /branch to different feedback trials based on whether the response latency is slower than the cut-off value, etc.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31757"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thank you for your reply. Could you provide a bit more clarification regarding the step about retrieving the nth value and storing it as a value? Am I creating a separate item from the list I've sorted at the end of the block? I'm just a little unclear how to adapt the code based on the link you provided.&lt;br/&gt;&lt;br/&gt;Thank you in advance! &lt;a class="if-quote-goto quote-link" href="#" data-id="31759"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You already have a list containing the correct RTs. So then you sort it in ascending order at the end of the block, calculate the index -- 0.3 * the list's itemcount, rounded to the nearest whole number -- and retrieve the item at that index*:&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;block shortnoreward_final&amp;gt;&lt;br/&gt;/ onblockend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sort correct RTs in ascending order&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT.sort(true, false);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// calculate index&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.index = round(0.3 * list.corrRT.itemcount);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// get 30th percentile from list&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.cutoff_RT = list.corrRT.item(values.index);&lt;br/&gt;]&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_No,AX_Short_No,AX_Short_No,AX_Short_No,BX_Short_No,AY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No)]&lt;br/&gt;&amp;lt;/block&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;*There's no universal definition of percentile. In some definitions the index value is taken as the percentile value. In others, it's value after that in the sorted data set, in again others, the percentile value is taken as the average of those two values, so adjust the calculatin according to your preferences.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31760"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thank you so much! That makes sense. I also took your feedback and used the branch attribute to give specific feedback based on the response time or the participant’s answer. However, I have run into the following problems:&lt;br/&gt;&lt;br/&gt;1. In addition to having the branch be conditional based on whether the participant is correct/incorrect/responds in time, I’m hoping to set it up so that the feedback presented to the participant is dependent on the “precue” that is presented  on that trial. Specifically, I have it set up where the “precue” is either the “$” or “■” (and then this is stored as a value). Is there a way to set it up so that if the participant answers correctly when they are presented with a “$” value, they are given the feedback in the trial “correctfb” but if they are correct and presented with a “■” they are given a different feedback message (i.e., trial “correct_norewardfb”)?  Based on looking online, I believe I have to use&amp;nbsp; “&amp;amp;&amp;amp;”, but I’m not entirely sure. (Script below):&lt;br/&gt;&lt;br/&gt;&amp;lt;trial AX_Short_Reward&amp;gt;&lt;br/&gt;/ inputdevice = keyboard&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.precue = list.precue.nextvalue;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.cue = "A";&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.probe = "X";&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(shape.eraser, expressions.precueeraser);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.cue, expressions.cue);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.fixation, expressions.shortdelay);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.AX_Short_Reward.insertstimulustime(text.probe, expressions.probe_short);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;/ stimulustimes = [0 = precue]&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.countcorrect += trial.AX_Short_Reward.correct;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.countcorrect_AX_Short_Reward += trial.AX_Short_Reward.correct;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_AX.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_AX_Short_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Short_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Short.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.ACC_Reward.appenditem(trial.AX_Short_Reward.correct);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (trial.AX_Short_Reward.correct){&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_AX.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_AX_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT_Short.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_AX.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_AX_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Short_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Reward.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.RT_Short.appenditem(trial.AX_Short_Reward.latency);&lt;br/&gt;]&lt;br/&gt;/ correctresponse = ("E")&lt;br/&gt;/ validresponse = ("E", "I")&lt;br/&gt;/ beginresponsetime = 1800&lt;br/&gt;/ timeout = 1800+values.cutoff_RT&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.response==0)trial.tooslowfb]&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.error)trial.errorfb]&lt;br/&gt;/branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(trial.AX_Short_Reward.correct)trial.correctfb]&lt;br/&gt;/ posttrialpause = parameters.iti&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial correctfb&amp;gt;&lt;br/&gt;/stimulustimes = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0=correctstim&lt;br/&gt;]&lt;br/&gt;/ validresponse = (0)&lt;br/&gt;/ timeout = 1000&lt;br/&gt;/ posttrialpause = 250&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial correct_norewardfb&amp;gt;&lt;br/&gt;/stimulustimes = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0=correct_norewardstim&lt;br/&gt;]&lt;br/&gt;/validresponse = (0)&lt;br/&gt;/timeout = 1000&lt;br/&gt;/ posttrialpause = 250&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;2. I also created another set of blocks (“longnoreward_final” and “longreward_final”), where I hope to incorporate the same feature where the RT cut-off for the trials in “longreward_final” is the 30th percentile of the RTs from the baseline block (“longnoreward_final”). However, when I run it as the next set of blocks, the value does not seem to be properly updated, and seems to store the value used in block 2 (“shortreard_final”). Is there a way to reset/change this value? Or would I have to create a separate value to be used in block 4 (longreward_final) based on the values from block 3 (longnoreward_final)? (Script below):&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;block shortnoreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (intronoreward)&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_No,AX_Short_No,AX_Short_No,AX_Short_No,BX_Short_No,AY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No)]&lt;br/&gt;/ onblockend = [list.corrRT_baseline_short.sort(false,false);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;values.index = round(0.3*list.corrRT_baseline_short.itemcount);&lt;br/&gt;values.cutoff_RT = list.corrRT_baseline_short.item(values.index);&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block shortreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (introreward)&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_Reward,AX_Short_Reward,AX_Short_Reward,AX_Short_Reward,BX_Short_Reward, AY_Short_Reward,BY_Short_Reward,BY_Short_Reward,BY_Short_Reward,BY_Short_Reward)]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block longnoreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (intronoreward)&lt;br/&gt;/trials = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1-10 = noreplace(AX_Long_No,AX_Long_No,AX_Long_No,AX_Long_No,BX_Long_No, AY_Long_No, BY_Long_No, BY_Long_No, BY_Long_No,BY_Long_No,)&lt;br/&gt;]&lt;br/&gt;/ onblockend = [list.corrRT_baseline_long.sort(false,false);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;values.index = round(0.3*list.corrRT_baseline_long.itemcount);&lt;br/&gt;values.cutoff_RT = list.corrRT_baseline_long.item(values.index);&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block longreward_final&amp;gt;&lt;br/&gt;/ preinstructions = (introreward)&lt;br/&gt;/trials = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1-10 =noreplace(AX_Long_Reward,AX_Long_Reward,AX_Long_Reward,AX_Long_Reward,BX_Long_Reward, AY_Long_Reward, BY_Long_Reward, BY_Long_Reward, BY_Long_Reward, BY_Long_Reward)&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thank you so much in advance!</description><pubDate>Mon, 28 Jun 2021 20:18:07 GMT</pubDate><dc:creator>ivy.c</dc:creator></item><item><title>RE: Calculating RT percentiles as cutoff scores</title><link>https://forums.millisecond.com/Topic31760.aspx</link><description>&lt;blockquote data-id="31759" class="if-quote-wrapper" unselectable="on" data-guid="1624620364315" id="if_insertedNode_1624620363254" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31759" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31759" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31759" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/25/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31759"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31757" class="if-quote-wrapper" unselectable="on" data-guid="1624620364315" id="if_insertedNode_1624587356754" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31757" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31757" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31757" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31757"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31756" class="if-quote-wrapper" unselectable="on" data-guid="1624620364315" id="if_insertedNode_1624567836148" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31756" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31756" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31756" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31756"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello, &lt;br/&gt;&lt;br/&gt;My coding knowledge is rather rudimentary, so I would appreciate any help with the following questions. &lt;br/&gt;&lt;br/&gt;I was wondering if it is possible to calculate the fastest 30th percentile of correct reaction times from a baseline block, and use this new reaction time value as the cut-off reaction time in the next block? Specifically, I’m hoping to use the RT from the correct responses in my “No Reward” trials/blocks, calculate the fastest 30th percentile value, and incorporate this value as cut-off&amp;nbsp; RT for the trials in my following “Reward” incentive block for each participant.&lt;br/&gt;&lt;br/&gt;In addition, is there a way to  manipulate/have two different feedback messages dependent on the participant’s response? Specifically, is there a way to set it up so that if they reply accurately but slower than the RT cutoff (as determined above in the previous “No Reward” block) they receive a “Trial Over” feedback message, but if they respond incorrectly they receive an “Error” message? I currently have it set up as messages for incorrect message and correct message, but was wondering if there would be a way to make this conditional.  In line with this, is there a way to change the feedback message for the correct response to also be based on the precue shown in the trial? &lt;br/&gt;&lt;br/&gt;I have attached my script for details. Thank you so much in advance!&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31756"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Re. 1), &lt;br/&gt;-&amp;nbsp; put the relevant RTs in a &amp;lt;list&amp;gt; at runtime &lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- sort the list at the end of the baseline block&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- then retrieve nth value from the list correponding to the 30th percentile as your cut-off and store it in a value&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Re. 2), yes, you can /branch to different feedback trials based on whether the response latency is slower than the cut-off value, etc.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31757"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thank you for your reply. Could you provide a bit more clarification regarding the step about retrieving the nth value and storing it as a value? Am I creating a separate item from the list I've sorted at the end of the block? I'm just a little unclear how to adapt the code based on the link you provided.&lt;br/&gt;&lt;br/&gt;Thank you in advance! &lt;a class="if-quote-goto quote-link" href="#" data-id="31759"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You already have a list containing the correct RTs. So then you sort it in ascending order at the end of the block, calculate the index -- 0.3 * the list's itemcount, rounded to the nearest whole number -- and retrieve the item at that index*:&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;block shortnoreward_final&amp;gt;&lt;br/&gt;/ onblockend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sort correct RTs in ascending order&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.corrRT.sort(true, false);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// calculate index&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.index = round(0.3 * list.corrRT.itemcount);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// get 30th percentile from list&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.cutoff_RT = list.corrRT.item(values.index);&lt;br/&gt;]&lt;br/&gt;/ trials = [1-10 = noreplace(AX_Short_No,AX_Short_No,AX_Short_No,AX_Short_No,BX_Short_No,AY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No,BY_Short_No)]&lt;br/&gt;&amp;lt;/block&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;*There's no universal definition of percentile. In some definitions the index value is taken as the percentile value. In others, it's value after that in the sorted data set, in again others, the percentile value is taken as the average of those two values, so adjust the calculatin according to your preferences.&lt;br/&gt;</description><pubDate>Fri, 25 Jun 2021 11:33:17 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Calculating RT percentiles as cutoff scores</title><link>https://forums.millisecond.com/Topic31759.aspx</link><description>&lt;blockquote data-id="31757" class="if-quote-wrapper" unselectable="on" data-guid="1624587358263" contenteditable="false" id="if_insertedNode_1624587356754"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31757" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31757" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31757" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31757"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="31756" class="if-quote-wrapper" unselectable="on" data-guid="1624587358263" id="if_insertedNode_1624567836148" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31756" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31756" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31756" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31756"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello, &lt;br/&gt;&lt;br/&gt;My coding knowledge is rather rudimentary, so I would appreciate any help with the following questions. &lt;br/&gt;&lt;br/&gt;I was wondering if it is possible to calculate the fastest 30th percentile of correct reaction times from a baseline block, and use this new reaction time value as the cut-off reaction time in the next block? Specifically, I’m hoping to use the RT from the correct responses in my “No Reward” trials/blocks, calculate the fastest 30th percentile value, and incorporate this value as cut-off&amp;nbsp; RT for the trials in my following “Reward” incentive block for each participant.&lt;br/&gt;&lt;br/&gt;In addition, is there a way to  manipulate/have two different feedback messages dependent on the participant’s response? Specifically, is there a way to set it up so that if they reply accurately but slower than the RT cutoff (as determined above in the previous “No Reward” block) they receive a “Trial Over” feedback message, but if they respond incorrectly they receive an “Error” message? I currently have it set up as messages for incorrect message and correct message, but was wondering if there would be a way to make this conditional.  In line with this, is there a way to change the feedback message for the correct response to also be based on the precue shown in the trial? &lt;br/&gt;&lt;br/&gt;I have attached my script for details. Thank you so much in advance!&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31756"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Re. 1), &lt;br/&gt;-&amp;nbsp; put the relevant RTs in a &amp;lt;list&amp;gt; at runtime &lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- sort the list at the end of the baseline block&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;- then retrieve nth value from the list correponding to the 30th percentile as your cut-off and store it in a value&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Re. 2), yes, you can /branch to different feedback trials based on whether the response latency is slower than the cut-off value, etc.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31757"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi Dave, &lt;br/&gt;&lt;br/&gt;Thank you for your reply. Could you provide a bit more clarification regarding the step about retrieving the nth value and storing it as a value? Am I creating a separate item from the list I've sorted at the end of the block? I'm just a little unclear how to adapt the code based on the link you provided.&lt;br/&gt;&lt;br/&gt;Thank you in advance! </description><pubDate>Fri, 25 Jun 2021 02:34:02 GMT</pubDate><dc:creator>ivy.c</dc:creator></item><item><title>RE: Calculating RT percentiles as cutoff scores</title><link>https://forums.millisecond.com/Topic31757.aspx</link><description>&lt;blockquote data-id="31756" class="if-quote-wrapper" unselectable="on" data-guid="1624567837923" id="if_insertedNode_1624567836148" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31756" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31756" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31756" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ivy.c - 6/24/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31756"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello, &lt;br/&gt;&lt;br/&gt;My coding knowledge is rather rudimentary, so I would appreciate any help with the following questions. &lt;br/&gt;&lt;br/&gt;I was wondering if it is possible to calculate the fastest 30th percentile of correct reaction times from a baseline block, and use this new reaction time value as the cut-off reaction time in the next block? Specifically, I’m hoping to use the RT from the correct responses in my “No Reward” trials/blocks, calculate the fastest 30th percentile value, and incorporate this value as cut-off&amp;nbsp; RT for the trials in my following “Reward” incentive block for each participant.&lt;br/&gt;&lt;br/&gt;In addition, is there a way to  manipulate/have two different feedback messages dependent on the participant’s response? Specifically, is there a way to set it up so that if they reply accurately but slower than the RT cutoff (as determined above in the previous “No Reward” block) they receive a “Trial Over” feedback message, but if they respond incorrectly they receive an “Error” message? I currently have it set up as messages for incorrect message and correct message, but was wondering if there would be a way to make this conditional.  In line with this, is there a way to change the feedback message for the correct response to also be based on the precue shown in the trial? &lt;br/&gt;&lt;br/&gt;I have attached my script for details. Thank you so much in advance!&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31756"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Re. 1), &lt;br/&gt;-&amp;nbsp; put the relevant RTs in a &amp;lt;list&amp;gt; at runtime &lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/appenditem.htm&lt;/a&gt;&lt;br/&gt;- sort the list at the end of the baseline block&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/sort.htm&lt;/a&gt;&lt;br/&gt;- then retrieve nth value from the list correponding to the 30th percentile as your cut-off and store it in a value&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/item.htm&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Re. 2), yes, you can /branch to different feedback trials based on whether the response latency is slower than the cut-off value, etc.&lt;br/&gt;&lt;br/&gt;</description><pubDate>Thu, 24 Jun 2021 20:59:47 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>