counterbalancing 4 blocks
in OpenSesame
hi,
I am quite new to OpenSesame, so I am currently doing an experiment that involves in 4 block, and I am trying to counter-balance the order of the blocks, which should have 24 different combinations. I have watched the counter-balancing tutorials, and I only have 4 combinations after followed those steps mentioned in the video, so could someone help?
many thanks
may
Comments
Hi,
For this, you need to do a few things:
itertools.permutations().subject_nrvariableblock1,block2, etc.This probably sounds a bit abstract, but it's not that complicated. I attached a simple example.
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Is
psychopy.tools.itertoolsdeprecated? In favour of what?If so, why is it not MOVED to removed folder, like `iohub`'s deprecated modules?
@sebastiaan Can you please attach the example you said you would attach???
Hi @sebastiaan
I need your example too. Can please attach it if you still have it?
Thanks a lot!
Hi @SezerReng and @VictorVarela ,
Here is the example again. (Some attachments got lost during a server crash some time ago.)
The crucial part is the script in init_counterbalancing item. This gets the block order based on a permutation of all possible block orders and the subject number.
import itertools as it # Gets a list of block orders, where each block order is itself a list # of the four block numbers, e.g. [3, 2, 1, 4] all_block_orders = list(it.permutations([1, 2, 3, 4])) # The current block order depends on the subject number, while wrapping # around so that participant 0 and 24 have the same order current_block_order = all_block_orders[var.subject_nr % len(all_block_orders)] print('block_order = {!s}'.format(current_block_order)) # Assign the block orders to these variables, which will be used in the # loop table of counterbalanced_loop var.block1, var.block2, var.block3, var.block4 = current_block_orderGood luck!
— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Sorry for the late reply Sebastiaan,
It worked really smoothly, thank you so much for your solution!
Best regards,
Sezer