Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Showing a Random Subset of cbc exercises

in my study I want to test the effect of different labeldesigns via running multiple different cbc exercises. thus, while I create four cbc exercises, I want each participant to only carry out one randomly choosen exercise.

how can I achieve that?
asked Jul 8, 2019 by mira

1 Answer

0 votes
A (crude) way to do this would be to create a numeric pass-in variable (myrand)

Assign it a random integer value between 1 and N where N is the number of CBC exercises you have.

You can do this by putting
[% SetValue(myrand,RandNum(999,1,N)) %] 

in the footer of an early question.

Then use Skip Logic to determine which of the N CBC exercises a person sees, based on their  value of myrand.
myrand=1 people see CBC 1 only
myrand=2 people see CBC 2 only
 myrand=N people see CBC N only

Use “Generate Data” from the Test menu to send simulated respondents  through the survey and then check that people only see one CBC exercise.

Sorting the data by myrand will make that easier to see if you are checking this visually (safer to check non-visually, especially if N is large)

answered Jul 8, 2019 by dan r Bronze (2,140 points)
edited Jul 9, 2019 by dan r
Thank you dan for your quick answer....I copies the syntax and got the following error massage when trying to generate data:

1. Error: Question 'Q5' - Footer - The symbol 'myrand' does not exist.

probably I am doing something wrong?
Perhaps you did not create a Pass-In Field named myrand?

From the Access menu go to the Pass-In Field tab
Enter the field name:  myrand
Denote it as Whole Number rather than Text

Note that 'myrand' is just the name I chose, you can name this variable differently