Millisecond Online Community

Selecting blocks

rated by 0 users
This post has 3 Replies | 1 Follower

Top 200 Contributor
Posts 7
Balcon Posted: 07-13-2010 2:03 PM

Hi all,

There are 2 blocks X and Y and 4 blocks a, b, c, d. I wish to link Block X to blocks a and b, and block Y to blocks c and d so that:  if I randomly select one from the first two blocks (X and Y), say X, then the experiment will automatically randomly select  one block from either a or b and similarly, if block Y is selected, then block c or d will be randomly selected as a second block in the experiment.

Thanks for all the help!

B

Top 10 Contributor
Posts 2,031

First, have your <expt> element randomly select either <block X> or <block Y>:

<expt>
/ blocks = [1=noreplace(X, Y); ...]
[...]
</expt>

Have both <block X> and <block Y> write an unique identifier to a <values> entry:

<values>
/ blockid = ""
</values>

<block X>
/ onblockbegin = [values.blockid = "X"]
[...]
</block>

<block Y>
/ onblockbegin = [values.blockid = "Y"]
[...]
</block>

Use the '/ skip' attribute in the remaining <block> elements (a,b,c,d) to omit blocks based on 'values.blockid':

<block a>
/ skip = [values.blockid=="Y"]
[...]
</block>

<block b>
/ skip = [values.blockid=="Y"]
[...]
</block>

<block c>
/ skip = [values.blockid=="X"]
[...]
</block>

<block d>
/ skip = [values.blockid=="X"]
[...]
</block>

Lastly, add these blocks to the <expt> element:

<expt>
/ blocks = [1=noreplace(X, Y); 2-5=noreplace(a, b, c, d)]
[...]
</expt>

This should result in only the correct blocks being run. Let me know if not.

~Dave

"To understand recursion, you must first understand recursion."  - Unknown Zen Master

Top 10 Contributor
Posts 2,031

Come to think of it, here's something a little less iffy. Just set up two <expt> elements:

<expt>
/ blocks = [1=X; 2-3=noreplace(a, b)]
/ subjects = (1 of 2)
/ groupassignment = random
</expt>

<expt>
/ blocks = [1=Y; 2-3=noreplace(c, d)]
/ subjects = (2 of 2)
/ groupassignment = random
</expt>

Regards,

~Dave

"To understand recursion, you must first understand recursion."  - Unknown Zen Master

Top 200 Contributor
Posts 7

It works! Thanks for the help Dave

Page 1 of 1 (4 items) | RSS
Powered by Community Server (Non-Commercial Edition), by Telligent Systems