task switching where the type of previous 3 trials matter
Hello everyone,
First of all I am well aware that my question may sound very silly, but I am very new to this language and 100% sure that there must be a more convenient method of implementing my design than what I was considering.
I am designing a task switching experiment where I am not only interested if there has been a switch in the last trial, but also whether there has been a switch in the previous three trials. So I try to manipulate the length of seeing the same task. Thus, a variable I have will be the number of previous repeats (3 levels: 2,1,0)
To illustrate, let's say the sorting variables are gender and age. I will present
aaag, ggga -switch with two previous repeats
gaag, agga-switch one previous repeat
()()ag,()()ga- switch with no previous repeat
1) Though I am only interested in accuracy and response time of the current trial, how may I know what the previous three trials were? Shall I make a variable for each of the four trials?
2) How may I make sure that overall each previous repeat condition is seen one third of the time, and occurs in each possible combination? (let's say aaag and ggga)
Thanks in advance
Comments
Hi,
Unfortunately, there is no easy, standardized way of doing it, that is, you have to write the conditions yourself in Python. However, if you give me more information on what is an experimental variable that needs to be counterbalanced and what are variables that can be random, I can write a little script that gets you started.
In essence, you would create the trials for a block all in advance so that you are in full control when switches occur at any point in your experiment (because you have all trials stored in a list).
Eduard
Dear Eduard,
Thanks for your reply. To illustrate it better, let's say that the tasks are categorizing an object either according to the shape or direction based on the cue. However, there is an irrelevant feature of the object to be manipulated, which is the color of the object and we will measure the switch rate in change from one color to other. My variable will be the number of times the color repeats before it switches, with the assumption that more repeats will result in longer response rate in switch. Thus, I want to compare the times that the color repeats 3 times before, 2 times before and appears only once before it switches (3 levels). So I will manipulate
task condition (2 levels: switch vs repeat of task)
task (2 levels: shape vs direction)
irrelevant cue (3 levels: 3 colors)
repeats of irrelevant cue before switch (3 levels) ---- of importance only when there is a switch
irrelevant cue condition (switch color vs repeat color)
I know this is very complicated, and thus I will probably do it manually. Do you know anyway of logging answers with a if-then rule, such as log as 3 repeat if color in trial 1=color in trial 2= color in trial 3?
Also what is the variable name python uses for trials or stimuli that repeat each other? In other words, how may I write a code with a if clause such as "if color in previous trial is the same as color in current trial".
There may be a way of commanding this other than what I have suggested, yet I am very new to OpenSesame and lack the knowledge of tools to implement my design at the moment.
Thanks in advance for your help
Using Opensesame variables for that experiment and choosing colors, tasks, etc. live on every trial, will be a pain. Rather, run a script in the beginning of every block, that defines the variables for all trials at once. Then on each trial, you would just select the current trial info, and you're set. So, you should use an
inline_scriptfor that, and how you call the variables is completely up to you.Ok. And which one of these factors do you want to have to be balanced? That is, should there be the same number of repeats and switches? Same number of shape and direction task trials? Etc... Also keep in mind which interactions you want to balance (e.g. same amount of trials for each number of repeats before switch, for each task condition).
As you say, the current design is quite complicated and I doubt it is possible to balance out everything. For example, you can't have the same number of switches and repeats, if you have only the options of 1,2, and 3 repeats before a switch. To make it possible, you would need to allow also 0 repeats.
This script implements a version of your design, that I would consider reasonable:
try to understand the logic, and adjust to your needs. You can test the code in an
inline_scriptand the debug window (or a regular python console).Feel free to ask if anything is unclear.
Eduard