|
Post by vanessa on Feb 25, 2020 6:41:20 GMT
Dear community I am programming my own version of an BIAT which is the brief version of the IAT. I am stuck on one problem: i'd like the psrticipants to be able to correct their answer if wrong. If they press the wrong key, the stimuli should not reapear, i just want them to have some timeframe to correct the answer - but also i need to measure the RT until error, and until correction. If anyone could help me it would be so great! Best regards from switzerland, vanessa
|
|
|
Post by PsyToolkit on Feb 25, 2020 10:42:28 GMT
Hi, This should not be difficult to do. You can have something like a second "readkey" and you can even check if the second response is different from the first one and record that second response.
If you need specific help with your code, please contact psytoolkit@gmx.com
Best, Gijsbert Stoet
|
|
|
Post by skaiste on Mar 23, 2021 10:22:38 GMT
Vanessa, in case it could be helpfull I copy-paste relevant part from our IAT code:
task clima_crimine table clima_crimine keys a l font arial 20 show text "CAMBIAMENTO CLIMATICO" -300 -200 white #left category show text "ATTO CRIMINALE" 300 -200 white #right category show text @1 0 0 white readkey @2 99999999 set $tmp_rt RT #saves initial response RT set $tmp_status STATUS # saves initial response status set $total_rt RT # if initial response is correct, total RT will be equal to tmp_rt in the output if STATUS == WRONG #in case of an error it shows red x and reads key again draw off show text @1 0 0 white show text "x" 0 200 red readkey @2 99999999 set $total_rt expression RT + $tmp_rt #if initial response was erroneous, it sums rt of initial response and RT of the second readkey fi save BLOCKNAME @1 TABLEROW KEY $tmp_rt $tmp_status $total_rt STATUS #saves 2 RTs and 2 statuses
p.s. this allows for only one correction of response
|
|
|
Post by danaleighton on Apr 8, 2021 17:11:04 GMT
i'd like the psrticipants to be able to correct their answer if wrong. If they press the wrong key, the stimuli should not reapear, i just want them to have some timeframe to correct the answer - but also i need to measure the RT until error, and until correction. Hello Vanessa: See the below code that I created for the Race IAT (published to the library but not sure if it's there yet). I calculate the full time for unlimited numbers of corrections, per the improved scoring algorithm. I also save the number of attempts until correct. I display a red x if they are incorrect, and redisplay the stimulus. All of this matches the Project Implicit IAT. (edit) Here is a link to download the experiment from my OSF project: osf.io/g7cw8/task mixed set $attempts 0 ### records the number of attempts until correct response keys e i table Black_White_Good_Bad_list draw off if &order == 1 show text "African American" -250 -250 show text "European American" 250 -250 fi if &order == 2 show text "European American" -250 -250 show text "African American" 250 -250 fi show text "or" -250 -200 show text "Good" -250 -150 show text "or" 250 -200 show text "Bad" 250 -150 show text "If you make a mistake, a red X will appear. Press the other key to continue." 0 250 draw on delay 100 show rectangle 0 0 10 10 255 255 255 # fixpoint delay 200 clear -1 delay 200 while $endloop == 0 set $attempts increase 1 # add one attempt show bitmap @1 if &order == 1 readkey @2 9999999 fi if &order == 2 readkey @3 9999999 fi clear -1 set $rtime increase RT ### full response latency including error corrections per the improved scoring algorithm if STATUS != CORRECT show bitmap redx delay 300 clear -1 else set $endloop 1 fi while-end
|
|
|
Post by skaiste on Apr 9, 2021 16:28:20 GMT
See the below code that I created for the Race IAT (published to the library but not sure if it's there yet). I calculate the full time for unlimited numbers of corrections, per the improved scoring algorithm. I also save the number of attempts until correct. I display a red x if they are incorrect, and redisplay the stimulus. All of this matches the Project Implicit IAT. Dear Proffessor Leighton, Maybe you also know and could share, how you managed to alternate targets and attributes in the mixed trials block? I did not manage to refer nether to odd/even trials neither to two different lists in one task. I have extendedly explained this problem in here: psytoolkit.boards.net/thread/538/alternate-2-tasks-blockbest wishes, skaiste
|
|
|
Post by danaleighton on Apr 9, 2021 19:36:06 GMT
how you managed to alternate targets and attributes in the mixed trials block? I used the same method Gijsbert used in his IAT in the PsyToolkit library. Here is the blockorder: blockorder instructions instr1 White_Black_practice # block 3 - Stage 1 of the IAT procedure instr2 Good_Bad_practice # block 5 - Stage 2 instr3 mix_White_Good_20 # block 7 - Stage 3 instr4 mix_White_Good_40 # block 9 - Stage 4 instr5 Black_White_practice # block 11 - Stage 5 instr6 mix_Black_Good_40 # block 13 - Stage 6 instr7 mix_Black_Good_40 # block 15 - Stage 7 analyze
Here are the corresponding blocks: # Stage 3 & 6 White/Good 20 trials (stereotype compatible) or Black/Good (stereotype incompatible) (counterbalanced) # NOTE in this implementation (not counterbalanced) Stage 6 is 40 trials as in Stage 7 below.
block mix_White_Good_20 set &order 2 ## order 2 means: Black=right,White=left tasklist mixed 20 all_before_repeat end
block mix_Black_Good_20 set &order 1 ## order 1 means: Black=left,White=right tasklist mixed 20 all_before_repeat end
# Stage 4 & 7 White/Good 40 trials (stereotype compatible) or Black/Good (stereotype incompatible)
block mix_White_Good_40 set &order 2 ## order 2 means: Black=right,White=left tasklist mixed 40 all_before_repeat end
block mix_Black_Good_40 set &order 1 ## order 1 means: Black=left,White=right tasklist mixed 40 all_before_repeat end
|
|
|
Post by skaiste on Apr 9, 2021 20:23:50 GMT
Thank you very much for the answer! Now I see that I did not express myself clearly enough.
Counterbalancing blocks is important, but I need that trials wihin the mixed block (both compatible and incompatible) are demonstrated in this sequence: random item from target list random item from attribute list random item from target list random item from attribute list ... all before repeat
|
|
|
Post by danaleighton on Apr 9, 2021 20:44:57 GMT
Oh I see. I have been thinking about this for a while, but can't see a way to do this. This is not how the IAT is typically constructed, and may bring the validity of your data into question, but I am sure you have a good reason for doing it this way. I can't think of a reason why the IAT would need the stimuli to be fully randomized, or why presenting random targets followed by random attributes would be a problem.
|
|
|
Post by skaiste on Apr 9, 2021 21:01:03 GMT
If you do not use it, I better stop insisting on this aspect. As project implicit (https://implicit.harvard.edu) was applying it, thought it's necessary. Thank you again! Your code is very useful for D counting.
|
|
|
Post by danaleighton on Apr 10, 2021 17:56:21 GMT
If you do not use it, I better stop insisting on this aspect. As project implicit (https://implicit.harvard.edu) was applying it, thought it's necessary. Thank you again! OH YES! You are right! I had never noticed that the target and attribute were presented in alternation during the mixed trials. Now that I re-read Greenwald, et al. (1998, p. 1465), I see that they do specify this ordering (emphasis mine): This is reiterated by Nosek et al. (2005, p. 167; emphasis mine): I suppose an interesting empirical question is whether it makes a difference. There is evidence that the alternating vs. random is not different - see Banse, et al. (2001, p. 147): They found no difference in Cronbach's alpha for random vs. alternating. But, of course, this is only one study, and the only study I could find that compared these presentation methods. So, I will try to revise my Race IAT for Version 2.0 so that alternating presentation orders can be used. I am not sure if that will be possible. If you think of a way, please post it here. References: Banse, R., Seise, J., & Zerbes, N. (2001). Implicit attitudes towards homosexuality: reliability, validity, and controllability of the IAT. Zeitschrift fur Experimentelle Psychologie, 48(2), 145-160. doi.org/10.1026//0949-3946.48.2.145Greenwald, A. G., McGhee, D. E., & Schwartz, J. L. K. (1998). Measuring individual differences in implicit cognition: the implicit association test. Journal of Personality and Social Psychology, 74(6), 1464. osf.io/zye9u/downloadNosek, B. A., Greenwald, A. G., & Banaji, M. R. (2005). Understanding and using the Implicit Association Test: II. Method variables and construct validity. P ersonality and Social Psychology Bulletin, 31(2), 166-180. doi.org/10.1177/0146167204271418
|
|
|
Post by skaiste on Apr 11, 2021 10:25:14 GMT
Very useful reference - we will probably need it! Alternation of targets and attributes should also reduce cognitive load, make a task easier. My efforts so far... As two tables can't be used for one task, I tried to refer directly to the bitmaps list (as in the task-switch example): task typeAtypeB set $typeA random 1 8 set $typeB random 1 8 while $typeA == &previoustyppeA || $typeB == &previoustypeB set $typeA random 1 8 set $typeB random 1 8 while-end set &previoustypeA $typeA set &previoustypeB $typeB set $typeBbitmap expression $typeB + 8 #attributes are bitmaps 9-16 keys a l set $oddeven expression (TRIALCOUNT - 2 * integer(TRIALCOUNT / 2)) if $oddeven == 0 set %stimulus $typeA else set %stimulus $typeB fi show bitmap %stimulus 0 0 save KEY RT STATUS The problem persists in a blue line, where I tried to define odd and even trials (modulo, or, so called, remainder, operator works only with surveys in psytoolkit, not experiments). Mainly, it does not use integer part of the number. For e.g. if trialnumber is 3, it returns $oddeven =(3 - 2*(3/2))=0. I want it to take only integer part of 3/2, then it would return $oddeven=(3-2*integer(3/2))=1. The second solution could be arrays: psytoolkit.boards.net/thread/481/choose-random-before-repeat-blocksThank you again for sharing ideas, skaiste
|
|
|
Post by regina on Nov 23, 2021 21:21:02 GMT
i'd like the psrticipants to be able to correct their answer if wrong. If they press the wrong key, the stimuli should not reapear, i just want them to have some timeframe to correct the answer - but also i need to measure the RT until error, and until correction. Hello Vanessa: See the below code that I created for the Race IAT (published to the library but not sure if it's there yet). I calculate the full time for unlimited numbers of corrections, per the improved scoring algorithm. I also save the number of attempts until correct. I display a red x if they are incorrect, and redisplay the stimulus. All of this matches the Project Implicit IAT. (edit) Here is a link to download the experiment from my OSF project: osf.io/g7cw8/task mixed set $attempts 0 ### records the number of attempts until correct response keys e i table Black_White_Good_Bad_list draw off if &order == 1 show text "African American" -250 -250 show text "European American" 250 -250 fi if &order == 2 show text "European American" -250 -250 show text "African American" 250 -250 fi show text "or" -250 -200 show text "Good" -250 -150 show text "or" 250 -200 show text "Bad" 250 -150 show text "If you make a mistake, a red X will appear. Press the other key to continue." 0 250 draw on delay 100 show rectangle 0 0 10 10 255 255 255 # fixpoint delay 200 clear -1 delay 200 while $endloop == 0 set $attempts increase 1 # add one attempt show bitmap @1 if &order == 1 readkey @2 9999999 fi if &order == 2 readkey @3 9999999 fi clear -1 set $rtime increase RT ### full response latency including error corrections per the improved scoring algorithm if STATUS != CORRECT show bitmap redx delay 300 clear -1 else set $endloop 1 fi while-end Hi Dana, thank your for sharing your code. This is very helpful. Just a quick follow-up question: Do you have an idea how one can measure the latency of the first keypress, if it is an error and participants give the correct answer on the 3rd attempt? If I understand the code correctly, rt = latency of the last response. If participants make 2 attempts, rt_1st = rtime - rt. However, how can I determine rt_1st if they make 3 or more attempts? Thank you,Regina
|
|
|
Post by regina on Nov 23, 2021 21:27:42 GMT
HI, here is my attempt of solving the alternate-issue in a BIAT, using "set &tagetattribute 1 or 2, depending on the previous type of trial. task t1_focal set $attempts_target 0 ### records the number of attempts until correct response set $attempts_attribute 0 ### records the number of attempts until correct response keys a l if &targetattribute == 1 set $item &&target_order remove first while $endloop == 0 set $attempts_target increase 1 #add one attempt show bitmap $item if $item < 6 #focal target readkey 2 10000 fi if $item > 5 && $item < 11 # non-focal target readkey 1 10000 fi set $rt_total_target increase RT #defines full response latency incuding error corrections if STATUS != CORRECT show bitmap X 0 100 else set $endloop 1 fi while-end clear range 6 20 #clears item and up to 13 red Xs delay 400 set &targetattribute 2 fi save BLOCKORDER BLOCKNAME BLOCKNUMBER TRIALCOUNT $item KEY RT $rt_total_target $attempts_target STATUS if &targetattribute == 2 set $item &&attribute_order remove first while $endloop2 == 0 set $attempts_attribute increase 1 #add one attempt show bitmap $item if $item > 10 && $item < 16 #positive focal attribute readkey 2 10000 fi if $item > 15 && $item < 21 #negative non-focal attribute readkey 1 10000 fi set $rt_total_attribute increase RT #defines full response latency incuding error corrections if STATUS != CORRECT show bitmap X 0 100 else set $endloop2 1 fi while-end clear range 6 20 #clears item and up to 13 red Xs delay 400 set &targetattribute 1 fi save BLOCKORDER BLOCKNAME BLOCKNUMBER TRIALCOUNT $item KEY RT $rt_total_attribute $attempts_attribute STATUS Very useful reference - we will probably need it! Alternation of targets and attributes should also reduce cognitive load, make a task easier. My efforts so far... As two tables can't be used for one task, I tried to refer directly to the bitmaps list (as in the task-switch example): task typeAtypeB set $typeA random 1 8 set $typeB random 1 8 while $typeA == &previoustyppeA || $typeB == &previoustypeB set $typeA random 1 8 set $typeB random 1 8 while-end set &previoustypeA $typeA set &previoustypeB $typeB set $typeBbitmap expression $typeB + 8 #attributes are bitmaps 9-16 keys a l set $oddeven expression (TRIALCOUNT - 2 * integer(TRIALCOUNT / 2)) if $oddeven == 0 set %stimulus $typeA else set %stimulus $typeB fi show bitmap %stimulus 0 0 save KEY RT STATUS The problem persists in a blue line, where I tried to define odd and even trials (modulo, or, so called, remainder, operator works only with surveys in psytoolkit, not experiments). Mainly, it does not use integer part of the number. For e.g. if trialnumber is 3, it returns $oddeven =(3 - 2*(3/2))=0. I want it to take only integer part of 3/2, then it would return $oddeven=(3-2*integer(3/2))=1. The second solution could be arrays: psytoolkit.boards.net/thread/481/choose-random-before-repeat-blocksThank you again for sharing ideas, skaiste
|
|
|
Post by danaleighton on Nov 23, 2021 21:51:03 GMT
Just a quick follow-up question: Do you have an idea how one can measure the latency of the first keypress, if it is an error and participants give the correct answer on the 3rd attempt? If I understand the code correctly, rt = latency of the last response. If participants make 2 attempts, rt_1st = rtime - rt. However, how can I determine rt_1st if they make 3 or more attempts? Regina - I think all you would do is to save the RT variable to a local variable if $attempts == 1 -- this would be done inside the "while $endloop == 0" structure. An alternate way would be to use an array variable to save the RT for each successive attempt into a series of array variables, then you would simply retrieve the first element of the array? I have not tested any of these ideas, but should work theoretically.
|
|
|
Post by regina on Nov 25, 2021 21:43:52 GMT
Hi Dana,
thank you very much - it works perferctly. Here is the part of my code of a B-IAT:
task t1_focal set $attempts_target 0 ### records the number of attempts until correct response set $attempts_attribute 0 ### records the number of attempts until correct response keys a l draw off text color green font mediumfont show text "focal target" 0 -280 text color yellow show text "positive" 0 -200 text color white font smallfont show text "or" 0 -240 draw on if &targetattribute == 1 #for alternating target and attribute trials set $item &&target_order remove first while $endloop == 0 set $attempts_target increase 1 #add one attempt show bitmap $item if $item < 6 #focal target readkey 2 10000 fi if $item > 5 && $item < 11 # non-focal target readkey 1 10000 fi if $attempts_target == 1 set $rt1_target RT #defines latency of first keypress (important in case of an error and more than 2 attempts) fi set $rt_total_target increase RT #defines full response latency incuding error corrections if STATUS != CORRECT show bitmap X 0 100 else set $endloop 1 fi while-end clear range 6 20 #clears item and up to 13 red Xs delay 400 set &targetattribute 2 #for alternating target and attribute trials fi save BLOCKORDER BLOCKNAME BLOCKNUMBER TRIALCOUNT $item KEY RT $rt1_target $rt_total_target $attempts_target STATUS if &targetattribute == 2 #for alternating target and attribute trials set $item &&attribute_order remove first while $endloop2 == 0 set $attempts_attribute increase 1 #add one attempt show bitmap $item if $item > 10 && $item < 16 #positive focal attribute readkey 2 10000 fi if $item > 15 && $item < 21 #negative non-focal attribute readkey 1 10000 fi if $attempts_attribute == 1 set $rt1_attribute RT #defines latency of first keypress (important in case of an error and more than 2 attempts) fi set $rt_total_attribute increase RT #defines full response latency incuding error corrections if STATUS != CORRECT show bitmap X 0 100 else set $endloop2 1 fi while-end clear range 6 20 #clears item and up to 13 red Xs delay 400 set &targetattribute 1 #for alternating target and attribute trials fi save BLOCKORDER BLOCKNAME BLOCKNUMBER TRIALCOUNT $item KEY RT $rt1_attribute $rt_total_attribute $attempts_attribute STATUS
|
|