Randomization | XM Community
Skip to main content
Solved

Randomization


Forum|alt.badge.img+1

I am conducting an experiment in which participants are presented with moral scenarios. There are 5 distinct conditions, each with 15 different versions. For each participant, I aim to randomly display a total of 50 scenarios, ensuring that 10 scenarios are selected from each condition. Additionally, I want the order of these scenarios to be completely randomized.

 

For example:

ScenarioType_IncidentalSelf -Dilemma #5 

ScenarioType_IncidentalOther - Dilemma #9

ScenarioType_InstrumentalSelf - Dilemma #13

ScenarioType_InstrumentalOther - Dilemma #3

ScenarioType_Filler - Dilemma #8

 

ScenarioType_InstrumentalSelf - Dilemma #1

ScenarioType_IncidentalOther - Dilemma #7

ScenarioType_Filler - Dilemma #12

ScenarioType_InstrumentalOther - Dilemma #2

ScenarioType_IncidentalSelf -Dilemma #9

 

ScenarioType_Filler - Dilemma #2

ScenarioType_InstrumentalOther - Dilemma #10

ScenarioType_InstrumentalSelf - Dilemma #4

ScenarioType_IncidentalSelf -Dilemma #1

ScenarioType_IncidentalOther - Dilemma #15

 

and so on…

 

Any suggestions?

Thank you.

 

Best answer by TomG

lkorenman wrote:

They are the same question, but there are technically 3 questions:

A timer

The scenario, each with the same multiple choice question

A slider question

 

I have 75 blocks, each with these 3 component, the only thing that differs is the scenario.

So, an easier way to do it would have been with one loop & merge block proceeded by 6 multiple choice questions (5 on one page, 1 on its own page) hidden with JavaScript to do the randomization.

Since you’ve already built all the blocks, you can do 5 randomizers to set embedded data field flags for each scenario/dilemma combo (in each you’ll display 10 of 15 evenly presented). Then you’ll have one randomizer to display all the selected blocks. It will look something like:

Randomizer: 10 of 15 Evenly Presented
  Group: Scenario 1 / Dilemma 1
    Set Embedded Data: Scenario1_Dilemma1 = 1
  Group: Scenario 1 / Dilemma 2
    Set Embedded Data: Scenario1_Dilemma2 = 1
  ...
  Group: Scenario 1 / Dilemma 15
    Set Embedded Data: Scenario1_Dilemma15 = 1
...
Randomizer: 10 of 15 Evenly Presented
  Group: Scenario 5 / Dilemma 1
    Set Embedded Data: Scenario5_Dilemma1 = 1
  Group: Scenario 5 / Dilemma 2
    Set Embedded Data: Scenario5_Dilemma2 = 1
  ...
  Group: Scenario 5 / Dilemma 15
    Set Embedded Data: Scenario5_Dilemma15 = 1
Randomizer: 75 of 75
  Branch: If Scenario1_Dilemma1 = 1
    Block: Scenario 1 / Dilemma 1
  Branch: If Scenario1_Dilemma2 = 1
    Block: Scenario 1 / Dilemma 2
  ...
  Branch: If Scenario5_Dilemma15 = 1
    Block: Scenario 5 / Dilemma 15

 

View original

10 replies

kgillis
Level 4 ●●●●
Forum|alt.badge.img+22
  • Level 4 ●●●●
  • 83 replies
  • February 21, 2025

I would build each condition in its own block then use survey flow to randomize and display 10 from each block.


Forum|alt.badge.img+1
  • Author
  • 6 replies
  • February 21, 2025

Thank you, but that only gets at ½ of the randomization I need. I also want the condition presentation to be random.


kgillis
Level 4 ●●●●
Forum|alt.badge.img+22
  • Level 4 ●●●●
  • 83 replies
  • February 21, 2025

So it would look something lik​@lkorenman 

 


kgillis
Level 4 ●●●●
Forum|alt.badge.img+22
  • Level 4 ●●●●
  • 83 replies
  • February 21, 2025

On the questions themselves (depending on which type of question(s) you’re using) you would then use choice randomization > advanced randomization.

 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5909 replies
  • February 21, 2025

@lkorenman,

What type of question or questions does a scenario consist of? Is each scenario the same question(s) with only different scenario text and/or image presented or is/are there unique question(s) for each scenario?


Forum|alt.badge.img+1
  • Author
  • 6 replies
  • February 21, 2025

They are the same question, but there are technically 3 questions:

A timer

The scenario, each with the same multiple choice question

A slider question

 

I have 75 blocks, each with these 3 component, the only thing that differs is the scenario.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5909 replies
  • Answer
  • February 21, 2025
lkorenman wrote:

They are the same question, but there are technically 3 questions:

A timer

The scenario, each with the same multiple choice question

A slider question

 

I have 75 blocks, each with these 3 component, the only thing that differs is the scenario.

So, an easier way to do it would have been with one loop & merge block proceeded by 6 multiple choice questions (5 on one page, 1 on its own page) hidden with JavaScript to do the randomization.

Since you’ve already built all the blocks, you can do 5 randomizers to set embedded data field flags for each scenario/dilemma combo (in each you’ll display 10 of 15 evenly presented). Then you’ll have one randomizer to display all the selected blocks. It will look something like:

Randomizer: 10 of 15 Evenly Presented
  Group: Scenario 1 / Dilemma 1
    Set Embedded Data: Scenario1_Dilemma1 = 1
  Group: Scenario 1 / Dilemma 2
    Set Embedded Data: Scenario1_Dilemma2 = 1
  ...
  Group: Scenario 1 / Dilemma 15
    Set Embedded Data: Scenario1_Dilemma15 = 1
...
Randomizer: 10 of 15 Evenly Presented
  Group: Scenario 5 / Dilemma 1
    Set Embedded Data: Scenario5_Dilemma1 = 1
  Group: Scenario 5 / Dilemma 2
    Set Embedded Data: Scenario5_Dilemma2 = 1
  ...
  Group: Scenario 5 / Dilemma 15
    Set Embedded Data: Scenario5_Dilemma15 = 1
Randomizer: 75 of 75
  Branch: If Scenario1_Dilemma1 = 1
    Block: Scenario 1 / Dilemma 1
  Branch: If Scenario1_Dilemma2 = 1
    Block: Scenario 1 / Dilemma 2
  ...
  Branch: If Scenario5_Dilemma15 = 1
    Block: Scenario 5 / Dilemma 15

 


Forum|alt.badge.img+1
  • Author
  • 6 replies
  • February 21, 2025

@TomG  - I am always looking for more efficient ways to do things in the future. Could you share the JavaScript solution or is there somewhere I might find an example?

 

Thank you


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5909 replies
  • February 21, 2025
lkorenman wrote:

@TomG  - I am always looking for more efficient ways to do things in the future. Could you share the JavaScript solution or is there somewhere I might find an example?

 

Thank you

The JavaScript part of the solution is trivial - either hiding a question or clicking the next button is one line of code.

The trick is in setting up the multiple choice questions and the loop & merge. In a block before the loop & merge, the first 5 MC questions would have 15 dilemmas as choices, and you use Advanced Randomization to display 10 of 15 evenly presented. The 6th MC question is on the next page, it has all 75 randomized scenarios/dilemmas as choices with choice display logic on each choice based on whether it was displayed in the question on the previous page. Then the loop & merge is based on the displayed choices in the 6th multiple choice question. That gives you one loop for each scenario/dilemma (75) with 50 randomly displayed. Set up your loop & merge fields with whatever you need piped into the questions for each scenario/dilemma.

 


Forum|alt.badge.img+1
  • Author
  • 6 replies
  • February 27, 2025

Thank you ​@TomG, many many survey flow commands later, it is working. Thank you again!

 

Lisa


Leave a Reply