Millisecond Forums

random trial selection

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

By plush - 1/16/2017

Hi guys, I wish to randomly start a trial. I was thinking of branching:

<trial agencyneg>
/branch = [trial.agencynegA]
/branch = [trial.agencynegL]
</trial>

<trial agencypos>
/branch = [trial.agencyposA]
/branch = [trial.agencyposL]
</trial>

<block main>
/ trials = [1-10 = noreplace
(agencypos, agencyneg);
11-12 = noreplace (eva_pos, eva_neg)]
</block>

However this always starts the first trial of the branch procedure.

Any advice is appreciated.

Thx!
By Dave - 1/16/2017

plush - Tuesday, January 17, 2017
Hi guys, I wish to randomly start a trial. I was thinking of branching:

<trial agencyneg>
/branch = [trial.agencynegA]
/branch = [trial.agencynegL]
</trial>

<trial agencypos>
/branch = [trial.agencyposA]
/branch = [trial.agencyposL]
</trial>

<block main>
/ trials = [1-10 = noreplace
(agencypos, agencyneg);
11-12 = noreplace (eva_pos, eva_neg)]
</block>

However this always starts the first trial of the branch procedure.

Any advice is appreciated.

Thx!

/branch attributes are checked in the order they are given. The first /branch that applies is executed. Since both of your /branches are unconditional, that will necessarily always be the first one.

The solution is to use <list> elements. I.e.

<trial agencyneg>
/ branch = [
    list.agencynegtrials.nextvalue
]

/ trialduration = 0
</trial>

<trial agencypos>
/ branch = [
    list.agencypostrials.nextvalue
]

/ trialduration = 0
</trial>

<list agencynegtrials>
/ items = (trial.agencynegA, trial.agencynegL)
</list>


<list agencypostrials>
/ items = (trial.agencyposA, trial.agencyposL)
</list>


<block main>
/ trials = [1-10 = noreplace(agencypos, agencyneg);
    11-12 = noreplace(eva_pos, eva_neg)]
</block>