How to randomly sample different amounts of items per trial without repetition


How to randomly sample different amounts of items per trial without...
Author
Message
Blackadder
Blackadder
Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)
Group: Forum Members
Posts: 280, Visits: 147
Hi All,

consider the following pseudo-code:

<item ITEM_same>
/ 1 = "pic_A1.jpg"
/ 2 = "pic_A2.jpg"
/ 3 = "pic_A3.jpg"
</item>

<item ITEM_diff>
/ 1 = "pic_B1.jpg"
/ 2 = "pic_B2.jpg"
/ 3 = "pic_B3.jpg"
/ 4 = "pic_B4.jpg"
</item>

<picture PIC_same1>
/ items = ITEM_same
/ select = noreplace
</picture>

<picture PIC_same2>
/ items = ITEM_same
/ select = noreplace
</picture>

<picture PIC_same3>
/ items = ITEM_same
/ select = noreplace
</picture>

<picture PIC_diff>
/ items = ITEM_diff
/ select = replacenorepeat
</picture>

<trial TRIAL_same>
/ stimulustimes = [0 = PIC_same1,PIC_same2,PIC_same3]
</trial>

<trial TRIAL_diff>
/ stimulustimes = [0 = PIC_diff,PIC_same1,PIC_same2]
</trial>


The problem is as follows. A "same" trial is supposed to present the three different pictures from ITEM_same simultaneously. A "diff" trial shows only two stimuli from ITEM_same and one stimulus from ITEM_diff.

It must never happen that the same picture is shown twice in a "same" trial. This, however cannot be guaranteed with the current script setup. After the first "diff" trial, there will be one element left in ITEM_same. This element will be chosen first on the next trial, then Inquisit will refill the item. This introduces the very likely chance that the element drawn before the counter was empty will be chosen again on that trial.

I know this could be circumvented by adding a

\ ontrialbegin = [item.ITEM_same.reset]


to TRIAL_same and TRIAL_diff, but can it be done without resorting to expression language?

Best wishes,
  Malte
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
(Browser crashed mid-reply, so let me try again in a little more detail. I apologize.)

(1) "It must never happen that the same picture is shown twice in a "same" trial. This, however cannot be guaranteed with the current script setup. After the first "diff" trial, there will be one element left in ITEM_same. This element will be chosen first on the next trial, then Inquisit will refill the item. This introduces the very likely chance that the element drawn before the counter was empty will be chosen again on that trial."

This is incorrect, because that's not what your example code actually does. Your three "same" <picture> elements represent three separate, independent selection pools. Each <picture> element will sample from the full set of three items in the <item> element without replacement. The fact that the <picture>s all reference the same <item> element does not establish a single, shared selection between them (a <list> or <counter> would). I.e., it is perfectly possible for the three <picture> elements to sample the exact same item in a given <trial>.

(2) Calling a reset on the <item> element is inadequate due to the above (it has no effect in this situation). If the elements were selecting items via a single <list> or <counter>, it is that <list> or <counter> that would have to be reset. This has to be done via an expression.
Blackadder
Blackadder
Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)
Group: Forum Members
Posts: 280, Visits: 147
Hi Dave,

I'm so sorry, I wasn't aware of that. In this case, I dumbed down the example too much. In our actual experiment, we use a counter, just like this.

<counter COUNTER_same>
/ items = (1, 2, 3, 4)
/ selectionrate = always
/ select = noreplace
</counter>

<item ITEM_same>
/ 1 = "pic_A1.jpg"
/ 2 = "pic_A2.jpg"
/ 3 = "pic_A3.jpg"
/ 4 = "pic_A4.jpg"
</item>

<picture PIC_same1>
/ items = ITEM_same
/ select = COUNTER_same
</picture>

<picture PIC_same2>
/ items = ITEM_same
/ select = COUNTER_same
</picture>

<picture PIC_same3>
/ items = ITEM_same
/ select = COUNTER_same
</picture>

<picture PIC_same4>
/ items = ITEM_same
/ select = COUNTER_same
</picture>

<picture PIC_diff>
/ items = ("pic_diff.jpg")
</picture>

<trial TRIAL_same>
/ stimulustimes = [0 = PIC_same1,PIC_same2,PIC_same3,PIC_same4]

</trial>
<trial TRIAL_diff>
/ stimulustimes = [0 = PIC_diff,PIC_same1,PIC_same2,PIC_same3]
</trial>


Our question remains the same: is there a way to refill the counter "COUNTER_same" at the end of each call to "TRIAL_diff"?

Best wishes, Malte
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
No, there is not [1]. Whether you opt for calling the reset() function at the end of the <trial> or adding further items to the <counter>, both have to be done via expressions in /ontrialend attributes or the like. I.e.

<trial TRIAL_diff>
/ ontrialend = [reset(counter.COUNTER_same); ]
...
</trial>

[1] If you absolutely *must* avoid using expressions (I cannot think of a reason), the ugly option is to have an additional stimulus element displayed by <trial TRIAL_diff>, but positioned off-screen:


<trial TRIAL_diff>
/ stimulustimes = [0 = PIC_diff,PIC_same1,PIC_same2,PIC_same3,TXT_dummysame4]
</trial>

<text TXT_dummysame4>
...
/ select = COUNTER_same
/ position = (-10%,-10%)
</text>


That would ensure that *both* <trial TRIAL_same> and <trial TRIAL_diff> sample the <counter> exhaustively (4 values per trial) in every instance. But as I said, this is quite ugly.

Edited 9 Years Ago by Dave
Blackadder
Blackadder
Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)
Group: Forum Members
Posts: 280, Visits: 147
Thanks again, Dave. We are currently compiling demo scripts for our Inquisit video course. Expressions should not enter the picture until a (much) later lesson and the script looked so innocent.

Maybe it'll be a nice teaser for learning the expression syntax, though. I think we'll go with introducing this little bit of expression syntax for this script.

Malte
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search