AAT (make blocks)


Author
Message
Sato
Sato
Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)
Group: Forum Members
Posts: 25, Visits: 126
Now I am making an Approach-Avoidance Task's script.

I want to record response time for each separate 10 blocks.
One block is consisted with 20 trials. I want to run the trials within each blocks randomly.

I made following script. 

<block AAT>
/ onblockbegin = [values.index = 0]
/ trials = [1-20 = AAT_start; 21-40 = AAT_start; 41-60 = AAT_start; 61-80 = AAT_start; 81-100 = AAT_start; 101-120 = AAT_start; 121-140 = AAT_start; 141-161 = AAT_start; 161-180 = AAT_start; 181-200 = AAT_start]
</block>

<expt >
...
/ blocks = [1 = SequenceGenerator; 2 = practice_AAT; 3 = AAT; 4 = AAT; 5 = AAT; 6 = AAT; 7 = AAT; 8 = AAT; 9 = AAT; 10 = AAT; 11 = AAT; 12 = AAT]
...
</expt>

I could run the script, and marked block numbers. 
However,  stimulus presentation was maybe not random, when I watched the raw data.

What code should I correct?
Attachments
20150611.iqx (815 views, 64.00 KB)
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
The stimulus presentation sequence / randomization is determined in <block SequenceGenerator> / <trial selectnumber> and associated elements according to the selection constraints detailed in the comments.

The resulting sequence is stored in values.sequence. The AAT "start" trials read out a single value from based on values.index, i.e, take with values.index at 0, take the 1st digit in values.sequence, then increase values.index by one. The next time <trial AAT_start> runs, it will take the 2nd digit in values.sequence (because values.index equals 1 at this point) and so forth:

<trial AAT_start>
/ ontrialbegin = [values.nextstimulus = substring(values.sequence, values.index, 1);
            values.index += 1]
...
</trial>

Since you reset values.index back to 0 at the start of

<block AAT>
/ onblockbegin = [values.index = 0]
...
</block>

every time you run that block via your <expt> the selection will restart from 0 / will be the same.

Sato
Sato
Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)
Group: Forum Members
Posts: 25, Visits: 126
Dear Dave

Thank you for your reply.
I was understand that my script makes same order.

I want to know how to run the random order trials.
What should I do now? 
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
If you don't want to restart from index 0 with every instance of <block AAT> (you run it several times via your <expt>), don't reset values.index to 0 at the start of <block AAT>:

<block AAT>
/ onblockbegin = [values.index = 0]
...
</block>

The current instance of <block AAT> will then pick up where previous instance left off.

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
Also, you run a *huge* number of trials. A single instance of <block AAT> runs 200 trials

<block AAT>
/ onblockbegin = [values.index = 0]
/ trials = [1-20 = AAT_start; 21-40 = AAT_start; 41-60 = AAT_start; 61-80 = AAT_start; 81-100 = AAT_start; 101-120 = AAT_start; 121-140 = AAT_start; 141-161 = AAT_start; 161-180 = AAT_start; 181-200 = AAT_start]
</block>

(the chunking into 20 trial-sections does not serve any purpose, btw)

and you run 10 instances of the block

<expt >
...
/ blocks = [1 = SequenceGenerator; 2 = practice_AAT; 3 = AAT; 4 = AAT; 5 = AAT; 6 = AAT; 7 = AAT; 8 = AAT; 9 = AAT; 10 = AAT; 11 = AAT; 12 = AAT]
...
</expt>

i.e. 2000 (!) trials total.

Now, if you look at the sequence generation code (please work through that again), you will find that you only generate a sequence of length 20. The relevant value here is values.totaltrialcount

<values>
...
/totaltrialcount = 20
</values>


*****************************************************************************
List Stimcats: contains all 80 possible stimuli
*****************************************************************************
Note: the number of item elements should be = values.totaltrialcount (editable value)

<list stimcats>
/ items = (
1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6)
/ replace = false
</list>

*****************************************************************************
Trial Selectnumber: selects the newnumber and checks whether
all constraints are met
- if all constraints are met: adds new number to sequence
- constraints are not met: checks whether an alternative number is available that could meet constraint
                => if yes: returns current number to list and tries again
                => if no: starts the sequence over
*****************************************************************************
...

I.e., you need to generate a *much* longer sequence if you actually want to run 2000 trials.

My gut feeling is that you actually want to do something like

<block AAT>
/ trials = [1-20 = AAT_start]
</block>

i.e. run *20* trials per block / run the block 10 times (200 trials total). You either need to generate a sequence of length 200 for that *or* generate a new sequence before each aat-block by re-running the sequence generation block before every aat-block.

Whatever the case, you absolutely *must* adjust the sequence generation according to the parameters applicable to your task (number of item categories, etc.).

Sato
Sato
Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)
Group: Forum Members
Posts: 25, Visits: 126
thank you for your advice.
However my script couldn't run whe delete "/ onblockbegin = [values.index = 0]".

I tried to fully random trial.

<block AAT>
/ trials = [1-20 = noreplace(AAT_1, AAT_2, AAT_3, AAT_4, AAT_5, AAT_6)]
</block>

It made the consequent data random.

How do you think this method?
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
Yes, if you don't need constrained randomization, you can absolutely do that.

Sato
Sato
Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)
Group: Forum Members
Posts: 25, Visits: 126
thank you for your comment.

When I delete "/ onblockbegin = [values.index = 0]", I couldn't run AAT experimental trials. (practice was OK)

<block AAT>
/ onblockbegin = [values.index = 0]
/ trials = [1-20 = AAT_start]
</block>

What code I have to write?
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
You need to make sure that values.index is equal to 0 when the test block(s) begin. If you look at the sequence generation code, you'll notice that <trial selectnumber> works with / increases values.index, i.e., once the pseudorandom sequence generation is done, values.index will *not* be equal to 0. You can set it to 0 at the end of the practice block:

<block practice_AAT>
/ onblockend = [values.index=0]
/ trials = [1-2 = instructions; 3-12 = noreplace(practicetrial_A, practicetrial_B); 13 = instructions; ]
</block>

Sato
Sato
Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)
Group: Forum Members
Posts: 25, Visits: 126
Wow! I could run the script!

Thank you very much!!!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search