Millisecond Forums

Randomly pair trials

https://forums.millisecond.com/Topic16306.aspx

By Nakayama Yao - 5/16/2015

Hi Inquisit Community,
Is it possible that we can randomly pair trials (not stimuli)? For example, I just want to randomly select one trial from (trial A, trial B, trial C), and then randomly select another trial from (trial D, trial E, trial F), and pair those two trials.
Since each stimulus varies its time duration on each trial, I might not be able to separate them. 
Is there a possible way to solve this?
Here is my script.
Thank you for your concern!
By Dave - 5/16/2015

> I just want to randomly select one trial from (trial A, trial B, trial C), and then randomly select another trial from (trial D, trial E,
> trial F) [...]

This is easily done using the <block> element's /trials attribute:

<block myblock>
/ trials = [1,3,5=noreplace(a,b,c); 2,4,6=noreplace(d,e,f)]
...
</block>

> [...] and pair those two trials.

I am, however, not sure whether "pairing" those trials is supposed to entail anything else beyond that. Please elaborate.
By Nakayama Yao - 5/17/2015

That's it, the one I want. Thank you and I appreciate it.
By Nakayama Yao - 5/18/2015

Mr. Dave,
Would you mind if I ask one more question?
I am aware that the "noreplace" actually reset every time it randomly choose a trial. To fix that I tried to use a "resetinterval" syntax, but it seems not working. Could you correct my mistakes? I really appreciate it.

<block TimeEstimation>
/postinstructions = (result)
/trials = [1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61=replace(timepresent1);
2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62=noreplace(timeeva1,timeeva2,timeeva3,
timeeva4,timeeva5,timeeva6,timeeva7,timeeva8,timeeva9,timeeva10,timeeva12,timeeva13,timeeva14,timeeva15,
timeeva16,timeeva17,timeeva18,timeeva19,timeeva20,timeeva21);
3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63=replace(question)]
</block>
<counter TimeEstimation>
/ resetinterval = 0
/ select = noreplace
</counter> 
By Dave - 5/18/2015

> I am aware that the "noreplace" actually reset every time it randomly choose a trial.

No, it does not. What makes you think it does?

A *stimulus* element's (<text>, <picture>, etc.) selection pool will by default reset between blocks. This is what can be overridden by the /resetinterval attribute. This does *not* apply to using noreplace() for trial selection in a <block>'s /trials attribute. I.e., when doing

<block someblock>
/ trials = [1,3,5=noreplace(a,b,c); 2,4,6=noreplace(d,e,f)]
...
</block>

you *will* end up with *exactly* 1 instance of trial "a", 1 instance of trial "b", etc.
By Nakayama Yao - 5/18/2015

Hi Mr. Davr,
Thank you for your reply. That is the part where I was confused when I ran the test, some trials still pop up more than one time.
For example, It would end up with:
timeeva1
timeeva17
timeeva16
timeeva21
timeeva6
timeeva4
timeeva1
timeeva3
timeeva2
timeeva3
timeeva14
timeeva19
timeeva12
timeeva15
timeeva15
timeeva7
timeeva13
timeeva18
timeeva16
timeeva5
timeeva7

If you could please check my syntax, that will be of great help to my study.
Thank you in advance.
  







By Dave - 5/18/2015

Look closely at

2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62=noreplace(timeeva1,timeeva2,timeeva3,
timeeva4,timeeva5,timeeva6,timeeva7,timeeva8,timeeva9,timeeva10,timeeva12,timeeva13,timeeva14,timeeva15,
timeeva16,timeeva17,timeeva18,timeeva19,timeeva20,timeeva21
);

You are sampling from the specified pool of trials on *21* occasions (the part in cursive). Your pool, however, has only *20* different trial elements in it (the part in bold). So something must *necessarily* repeat.

You'll notice that timeeva11 is *missing* from the pool.
By Nakayama Yao - 5/18/2015

Oh! Now I figured out where my mistake is.
Thank you very much for your help! You just saved us!