How to? randomly select exactly the same number of items from a list into 2 within sub. conditions /...


How to? randomly select exactly the same number of items from a list...
Author
Message
Kuba
Kuba
Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)
Group: Forum Members
Posts: 9, Visits: 205
Hi Everybody, Hi Dave

Sadly i couldn't  figure out yet how to program the following experimental scenario:

Basically its a false memory (DRM) task, flavored with lateral word exposition in the encoding phase.
But here i'm only interested in the recognition phase.
Overall i got 4 x 2  lists of words and i want to check if the study participants after seeing a word  press "Y" ( this word has been presented earlier)  or "N" (no it hasn't.)
Additionally in line with a within subjects design  the subjects should be randomly prompted to make  fast or slow decision (700ms or 2500 ms after the word onset respectively) by means of presenting them an error beep and shortly after (300ms) a "too slow" text message - see piece of "code" below. I also wanted to provide them with RT feedback after every trial. The RTs should be recorded as well.

<trial critAslow> 
/ stimulustimes = [0=FPcritA;2500=prompt;2800=slowmessage]
****** how to incorporate the RT feedback here so that it is visible and not erased by the / responseinterrupt = immediate property? probably via trial.critAslow.latency but where and how?:)*****
/ validresponse = ("t", "n")
/ correctresponse = ("t")
/ beginresponsetime = 0
/ responseinterrupt = immediate
/ posttrialpause = 2000
</trial>

The word Lists
* (A & B) refers to left or right in the encoding phase (which varies according to even or odd sub ID)
Crit lures A*             - 30 items
Crit lures B*             - 30 items
weak lures A*           - 30 items
weak lures B*           - 30 items
Studied words A*      - 60 items
Studied words B*      - 60 items
unrelated words (A)   - 60 items
unrelated words (B)   - 60 items
I wanted that for every participant exactly half of the words from every list will be randomly assigned to the fast and the "remaining" half to the slow retrieval condition.
Is that doable?

I would greatly appreciate any kind of help

Cheers
Kuba

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: 12K, Visits: 97K
Re. #1:

<trial critAslow> 
/ stimulustimes = [0=FPcritA;2500=prompt;2800=slowmessage]
****** how to incorporate the RT feedback here so that it is visible and not erased by the / responseinterrupt = immediate property? probably via trial.critAslow.latency but where and how?:)*****
/ validresponse = ("t", "n")
/ correctresponse = ("t")
/ beginresponsetime = 0
/ responseinterrupt = immediate
/ posttrialpause = 2000
/ branch = [trial.latencyfeedback]
</trial>

You /branch to a <trial> that provides the desired feedback. You cannot display the latency feedback in <trial critAslow>.

Re. #2:
"I wanted that for every participant exactly half of the words from every list will be randomly assigned to the fast and the "remaining" half to the slow retrieval condition.
Is that doable?"

Yes, that's perfectly doable. Ideally, distribute the items / item numbers to the various conditions (slow / fast) /onexptbegin. See e.g. https://www.millisecond.com/forums/Topic17069.aspx


Kuba
Kuba
Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)
Group: Forum Members
Posts: 9, Visits: 205
Thanks a Million Dave
This was very helpful, wonder how i could have missed the topic you've linked to (maybe better tagging would help)
Anyway, what i forgot to ask in the previous post/question  how to additionally randomize the presentation of the items so that they don't get displayed in a clustered way
i.e 30 critical lures then 60 studied and so on........

 i shifted the list property/function logic from the expt level to the block level:
FFP =Fast false positive - time retrieval condidion
FSP = slow false positive -time retrieval condidion
Bitems = list B - word list
Aitems = list A - word list
nuber of words in each list (A,B) is 6 (for now, in the process of testing the script)

<block CritAB>
/ onblockbegin =  = [list.categoryFFPcritAitems.appenditem(list.FPcritAitems.nextindex);
    list.categoryFFPcritAitems.appenditem(list.FPcritAitems.nextindex);
    list.categoryFFPcritAitems.appenditem(list.FPcritAitems.nextindex);
    list.categorySFPcritAitems.appenditem(list.FPcritAitems.nextindex);
    list.categorySFPcritAitems.appenditem(list.FPcritAitems.nextindex);
    list.categorySFPcritAitems.appenditem(list.FPcritAitems.nextindex);
    list.categoryFFPcritBitems.appenditem(list.FPcritBitems.nextindex);
    list.categoryFFPcritBitems.appenditem(list.FPcritBitems.nextindex);
    list.categoryFFPcritBitems.appenditem(list.FPcritBitems.nextindex);
    list.categorySFPcritBitems.appenditem(list.FPcritBitems.nextindex);
    list.categorySFPcritBitems.appenditem(list.FPcritBitems.nextindex);
    list.categorySFPcritBitems.appenditem(list.FPcritBitems.nextindex);]
/ trials = [1-12=noreplace(categorySFPcritA, categoryFFPcritA,categorySFPcritB,categoryFFPcritB)]
</block>

is that correct?

the outcome seems to suggest that yes it is (but it's short)
trialcode from the iqdat file
categorySFPcritA
latencyfeedback2
categoryFFPcritA
latencyfeedback1
categoryFFPcritA
latencyfeedback1
categoryFFPcritB
latencyfeedback4
categorySFPcritA
latencyfeedback2
categorySFPcritB
latencyfeedback3
categorySFPcritB
latencyfeedback3
categoryFFPcritB
latencyfeedback4
categoryFFPcritB
latencyfeedback4
categorySFPcritA
latencyfeedback2
categorySFPcritB
latencyfeedback3
categoryFFPcritA
latencyfeedback

if i understood well, when one list(say B=60 words) is 2 times bigger than an other (say A=30)
then in the block specification of the trial sequence it should look like
trials = [1-90=noreplace(A,B,B)]
right

A last question
if i want to create a data summary file where the number(or percentage) of correct responses and the mean condition RT is stored for 16 conditions list type (8levels) x retrievaltime(2levels) - one subject per row? how can one do that?  could you provide me a link to a post about that so that i can look up the logic behind that - it must have been discussed:)

Cheers
Kuba

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: 12K, Visits: 97K
>  i shifted the list property/function logic from the expt level to the block level:
> [...]
> is that correct?

It looks correct to me. Don't trust my word, though, but instead verify by testing / examining the data file.

> if i understood well, when one list(say B=60 words) is 2 times bigger than an other (say A=30)
> then in the block specification of the trial sequence it should look like
> trials = [1-90=noreplace(A,B,B)]
> right

Yes. You can also use a <list> for trial selection if you want to impose additional constraints to avoid "clustering" by using /maxrunsize:

<block myblock>
/ trials = [1-90=list.triallist]
</block>

<list triallist>
/ items = (trial.a, trial.b)
/ poolsize = 90
/ itemprobabilities = (0.33; 0.67)
/ maxrunsize = 4
</list>

<trial a>
/ trialduration = 10
</trial>

<trial b>
/ trialduration = 10
</trial>

> if i want to create a data summary file where the number(or percentage) of correct responses and the mean condition RT is stored for
> 16 conditions list type (8levels) x retrievaltime(2levels) - one subject per row? how can one do that?  could you provide me a link to a
> post about that so that i can look up the logic behind that - it must have been discussed:)

Use <expressions> along with the built-in performance metric functions (see the "Functions" reference in the documentation), and/or <values> to compute the metrics you desire. Log those values and expressions to the (summary) data file by specifying its columns attribute. Virtually all scripts in the library do stuff like that, if you need concrete examples. Numerous simple examples are also available in this forum, e.g. https://www.millisecond.com/forums/Topic17711.aspx


Kuba
Kuba
Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)
Group: Forum Members
Posts: 9, Visits: 205
Thanks Dave
everything is just perfect!

just one more (final) little question due to my neurosis:)
referring to your example with list elements. Is it important that the order of list elements mirrors the order of the  block sequence
i.e blocks = [1 = a_and_b; 2 = remaining]
like in your example
<expt>
/ onexptbegin = [list.categoryaitems.appenditem(list.nitems.nextindex);
    list.categoryaitems.appenditem(list.nitems.nextindex);
    list.categorybitems.appenditem(list.nitems.nextindex);
    list.categorybitems.appenditem(list.nitems.nextindex);
    list.remainingitems.appenditem(list.nitems.nextindex);
    list.remainingitems.appenditem(list.nitems.nextindex);
    list.remainingitems.appenditem(list.nitems.nextindex);
    list.remainingitems.appenditem(list.nitems.nextindex);]
/ blocks = [1 = a_and_b; 2 = remaining]
</expt>

or can it be freely intermixed if only the amount and proportion of list.elements is fulfilled?
expt>
/ onexptbegin = [ list.remainingitems.appenditem(list.nitems.nextindex);
    list.remainingitems.appenditem(list.nitems.nextindex);
list.categoryaitems.appenditem(list.nitems.nextindex);
    list.categoryaitems.appenditem(list.nitems.nextindex);
list.remainingitems.appenditem(list.nitems.nextindex);
    list.remainingitems.appenditem(list.nitems.nextindex);
    list.categorybitems.appenditem(list.nitems.nextindex);
    list.categorybitems.appenditem(list.nitems.nextindex;]
/ blocks = [1 = a_and_b; 2 = remaining]
</expt>

cheers kuba

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: 12K, Visits: 97K
list.nitems is set to sample randomly without replacement. You can think of list.nitems as a deck of 8 cards. Shuffle the deck. You want to then distribute them such that you end up with 2 (random) cards in a stack labeled "category a", 2 in a stack labeled "category b", and 4 in a stack called "remaining".

This should make clear that -- in this specific example --  it does not matter whether you first take 2 items (=cards) and put them in list.categoryaitems, then 2 items for list.categorybitems, and then select the remaining 4 for list.remainingitems or whether you change that order in any way.

Hope this clarifies.

Kuba
Kuba
Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)Partner Member (935 reputation)
Group: Forum Members
Posts: 9, Visits: 205
Thanks
This clarifies this issue perfectly.

I said in the last post, that it will be the final one....but in the meantme i tested the script, made some corrections and well one particualr issue is still my road block.

i defined the responserecording at 2 time points
/ beginresponsetime = 2500 / 500
the experiment goes www. now i'm anticipating that with no control from the experimenter the participants may (at least some of them) be constantly hiting one the response keys, ignoring the explicit instruction of responding only after hearing the prompt signal.
what i want is to give them on trial-by trial basis a warning whenever a too early response is detected....but i would like to keep / beginresponsetime = 2500 / 500.
i have imagined to set the / beginresponsetime = 0 and do some branching.... if trial.latency < 500/2500....but would it stiil be possible to record only the respnse after the prompt signal / and possibly keep also track of how many anticipation errors were made in the trial.


cheers
kuba


<trial CategorySlow>
/ stimulustimes = [0=categoryS;2500=prompt]
/ validresponse = ("t", "n")
/ correctresponse = ("t")
/ beginresponsetime = 2500
/ responseinterrupt = immediate
/ posttrialpause = 0
/ branch = [if (trial.categorySlow.latency > 1000) trial.slowmessageST]
/ branch = [if (trial.categorySlow.latency < 1000) trial.fastmessageST]
</trial>

<trial CategoryFast>
/ stimulustimes = [0=categoryF;500=prompt]
/ validresponse = ("t", "n")
/ correctresponse = ("t")
/ beginresponsetime = 500
/ responseinterrupt = immediate
/ posttrialpause = 0
/ branch = [if (trial.categoryFast.latency > 1000) trial.slowmessageFT]
/ branch = [if (trial.categoryFast.latency < 1000) trial.fastmessageFT]

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: 12K, Visits: 97K
> but would it stiil be possible to record only the respnse after the prompt signal / and possibly keep also track of how many anticipation
> errors were made in the trial.

To do this properly, you'd "split" the <trial> into two <trial>s -- one that displays "categoryS" for 2500ms (or 5000ms respectively) and counts the "false starts" / "anticipatory responses", another one that just displays the "prompt" stimulus and collects the "actual" response.

See the attached example and look at the "focus" <trial> that keeps track of the "false starts".

Attachments
example.iqx (778 views, 16.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search