# Within-subject randomization

Community Member - Trial User Qubie ✭

# Within-subject randomization

Hi everyone, I am a newbie and I need your helps for a within-subject randomization. In my survey, I have 100 blocks (block 1 to block 100), each block has 2 version (version A and version . It means I have 200 blocks in total, i.e. block 1A, block 1B, block 2A, block 2B, ….

Now I want to randomly show them 50 blocks including 25 blocks of version A and 25 blocks of version B, given that if a block is shown with version A, it will not be shown with version B.

If I put all of 200 blocks under a Randomizer in Survey Flow, and randomly choose 50 out of 200, it will lead to 2 problems:

• Problem 1: I may get 40 blocks of version A and 10 blocks of version B instead of 25 version A blocks and 25 version B blocks.
• Problem 2: one block may be shown with both version A and B.

Could you advise me how to use Qualtrics features to overcome 2 problem, especially problem 2?

Thank you very much.
Tomas

Tagged:

• Broomfield, COCommunity Member Wizard ✭✭✭✭✭

Problem 2 is easy to solve but will take extensive manual coding. Here's what to do:
1. After each of your 200 blocks, set an embedded data field for that block. For example, after block 92A, put an embedded data field named 92 and set it to yes. You'll want to do the exact same thing for block 92B. You'll use this to check if the other version of the block has already been presented.
2. Before each of your 200 blocks, use some branch logic to check if the other version of that block has already been presented. For both block 92A and 92B put branch logic "If Embedded Data field 92 does not contain Yes", in front of it then nest the block under the statement.

For Problem 1, does it matter if all 25 version A blocks are presented before the version B blocks?

• Community Member - Trial User Qubie ✭

@JenCX said:
Problem 2 is easy to solve but will take extensive manual coding. Here's what to do:
1. After each of your 200 blocks, set an embedded data field for that block. For example, after block 92A, put an embedded data field named 92 and set it to yes. You'll want to do the exact same thing for block 92B. You'll use this to check if the other version of the block has already been presented.
2. Before each of your 200 blocks, use some branch logic to check if the other version of that block has already been presented. For both block 92A and 92B put branch logic "If Embedded Data field 92 does not contain Yes", in front of it then nest the block under the statement.

For Problem 1, does it matter if all 25 version A blocks are presented before the version B blocks?

Thank you very much for your response.

Honestly, I do not fully understand your instruction, but I am trying to work on it. I hope I can implement it in Qualtrics because I really feel it can work, I just do not know how to do it in Survey Flow. In case I am not successful, could you help me to create a sample survey, then export it to QSF and upload it here? I will import this QSF file and see what you mean.

For problem 1, it is ideal if the order of presenting version A and version B blocks is random. However, if it is too difficult to implement in Qualtrics, a solution for displaying all 25 version A blocks first and then all version B blocks is still useful.

Thank you once again for your support.

• Broomfield, COCommunity Member Wizard ✭✭✭✭✭
edited November 2019

@Tomas My fault! You spoke so eloquently about what you'd set up, I assumed you were familiar with the survey flow. You can read more about that here.

Here's an example I made. Let me know if you have more questions, I'm happy to help assist (outside of building a sample with 200 blocks )

Edited to add: This structure will solve both of your problems. The A blocks will be grouped together, but it will randomly present either A or B first.

• Community Member - Trial User Qubie ✭

@JenCX said:
@Tomas My fault! You spoke so eloquently about what you'd set up, I assumed you were familiar with the survey flow. You can read more about that here.

Here's an example I made. Let me know if you have more questions, I'm happy to help assist (outside of building a sample with 200 blocks )

Edited to add: This structure will solve both of your problems. The A blocks will be grouped together, but it will randomly present either A or B first.

Thank you very much. You are very kind because spending a lot of time on the answer.

Based on the picture, I understand what you mean in the first reply. By using a top Randomizer, Qualtrics will present randomly group A or group B first, but is there any way to make Qualtrics mix A block and B block randomly? For example, a presenting order would be 92B, 90A, 80A, 14B, 58A, 78B, 11B, 26A, 77A, .... (given that we have exact 25 A-version and 25 B-version)?

With your support, I come very close to the ideal solution. You helped me to solve 2 big problems, and now it is very great if the presenting order is completely random instead of showing all block A first and block B first.

You are really a wizard in Qualtrics world. Thank you very much. I at least have a solution for discussing with my boss.