Semi-randomized blocks


Author
Message
Andrew Papale
Andrew Papale
Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)
Group: Forum Members
Posts: 67, Visits: 238
Hello,

I'd like to randomize blocks, but in groups, as in the following: 

1 = instructions
2-3 = group 1
4-5 = group2

where the order of (2-3) or (4-5) are counterbalanced.  Is this possible?

Thanks!
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: 105K
AndrewPapale - 5/19/2020
Hello,

I'd like to randomize blocks, but in groups, as in the following: 

1 = instructions
2-3 = group 1
4-5 = group2

where the order of (2-3) or (4-5) are counterbalanced.  Is this possible?

Thanks!

You can counterbalance by setting up two <expt> elements with the respective orders:

// group 1 blocks first
<expt>
/ blocks = [1=instructions;
2-3 = noreplace(group1_block_a, group1_block_b);
4-5 = noreplace(group2_block_a, group2_block_b);
]
/ groups = (1 of 2)
</expt>

// group 2 blocks first
<expt>
/ blocks = [1=instructions;
2-3 = noreplace(group2_block_a, group2_block_b);
4-5 = noreplace(group1_block_a, group1_block_b);
]
/ groups = (2 of 2)
</expt>
Andrew Papale
Andrew Papale
Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)Partner Member (994 reputation)
Group: Forum Members
Posts: 67, Visits: 238
(Sorry, it's really hard to post a reply to in this forum)

Thank you, I'll try this approach.  

I actually have 6 different blocks that I want to counterbalance.  Will I have to create a new <exp> for each possibility (probably infeasible given the number of possible combinations), or is there a way around this?

Thanks!
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: 105K
AndrewPapale - 5/20/2020
(Sorry, it's really hard to post a reply to in this forum)

Thank you, I'll try this approach.  

I actually have 6 different blocks that I want to counterbalance.  Will I have to create a new <exp> for each possibility (probably infeasible given the number of possible combinations), or is there a way around this?

Thanks!

"Counterbalancing" (the word you used) means what you want to do is systematic, i.e. the order is an (implicit at least) between-subjects condition. If that's the way you want to treat this, then yes, you need to create the requisite amount of <expt>s (i.e. between-subjects conditions). If you merely want to randomize groups of blocks, then there may be another way, but you'd have to be way more specific about what exactly it is you want to do.

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: 105K
Dave - 5/20/2020
AndrewPapale - 5/20/2020
(Sorry, it's really hard to post a reply to in this forum)

Thank you, I'll try this approach.  

I actually have 6 different blocks that I want to counterbalance.  Will I have to create a new <exp> for each possibility (probably infeasible given the number of possible combinations), or is there a way around this?

Thanks!

"Counterbalancing" (the word you used) means what you want to do is systematic, i.e. the order is an (implicit at least) between-subjects condition. If that's the way you want to treat this, then yes, you need to create the requisite amount of <expt>s (i.e. between-subjects conditions). If you merely want to randomize groups of blocks, then there may be another way, but you'd have to be way more specific about what exactly it is you want to do.

Here's a quick example how you can randomize groups of blocks by setting up one dummy block per group, sampling those dummy blocks in random order per the /blocks attribute, and then use <list> elements to run the actual blocks within each group.

<values>
/ n_blocks_in_group = 0
/ in_group_count = 0;
</values>

// randomize the order of the three groups of blocks
<expt>
/ blocks = [1-3 = noreplace(group1, group2, group3)]
</expt>

// dummy block initiating the execution of the group 1 blocks
<block group1>
/ onblockbegin = [
    values.n_blocks_in_group = list.group1_blocks.itemcount;
    values.in_group_count = 0;
]
/ branch = [
    list.group1_blocks.nextvalue;
]
</block>

// dummy block initiating the execution of the group 2 blocks
<block group2>
/ onblockbegin = [
    values.n_blocks_in_group = list.group2_blocks.itemcount;
    values.in_group_count = 0;
]
/ branch = [
    list.group2_blocks.nextvalue;
]
</block>

// dummy block initiating the execution of the group 3 blocks
<block group3>
/ onblockbegin = [
    values.n_blocks_in_group = list.group3_blocks.itemcount;
    values.in_group_count = 0;
]
/ branch = [
    list.group3_blocks.nextvalue;
]
</block>

// three blocks A to C in group 1
<list group1_blocks>
/ items = (block.group1_a, block.group1_b, block.group1_c)
</list>

<block group1_a>
/ onblockbegin = [
    values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
    if (values.in_group_count < values.n_blocks_in_group) {
        list.group1_blocks.nextvalue;
    }
]
</block>

<block group1_b>
/ onblockbegin = [
    values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
    if (values.in_group_count < values.n_blocks_in_group) {
        list.group1_blocks.nextvalue;
    }
]
</block>

<block group1_c>
/ onblockbegin = [
    values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
    if (values.in_group_count < values.n_blocks_in_group) {
        list.group1_blocks.nextvalue;
    }
]
</block>

// two blocks A to B in group 2
<list group2_blocks>
/ items = (block.group2_a, block.group2_b)
</list>

<block group2_a>
/ onblockbegin = [
    values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
    if (values.in_group_count < values.n_blocks_in_group) {
        list.group2_blocks.nextvalue;
    }
]
</block>

<block group2_b>
/ onblockbegin = [
    values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
    if (values.in_group_count < values.n_blocks_in_group) {
        list.group2_blocks.nextvalue;
    }
]
</block>

// four blocks A to D in group 3
<list group3_blocks>
/ items = (block.group3_a, block.group3_b, block.group3_c, block.group3_d)
</list>

<block group3_a>
/ onblockbegin = [
    values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
    if (values.in_group_count < values.n_blocks_in_group) {
        list.group3_blocks.nextvalue;
    }
]
</block>

<block group3_b>
/ onblockbegin = [
    values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
    if (values.in_group_count < values.n_blocks_in_group) {
        list.group3_blocks.nextvalue;
    }
]
</block>

<block group3_c>
/ onblockbegin = [
    values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
    if (values.in_group_count < values.n_blocks_in_group) {
        list.group3_blocks.nextvalue;
    }
]
</block>

<block group3_d>
/ onblockbegin = [
    values.in_group_count += 1;
]
/ trials = [1=mytrial]
/ branch = [
    if (values.in_group_count < values.n_blocks_in_group) {
        list.group3_blocks.nextvalue;
    }
]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("This is block <%script.currentblock%>. ~nIt is block number <%values.in_group_count%> in a group of <%values.n_blocks_in_group%> blocks.")
/ size = (75%, 30%)
</text>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search