Have an idea?

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

How can I read in rows of a CSV file and apply certain values in Free Format?

I've designed sets of product combinations in Excel, where the rows are unique combinations and columns are different attributes related to the question; I'd like to create a free format question where I update a short description of the products using values piped in from a CSV file.

What is the best way to 1) read in a CSV file into Sawtooth and 2) for a given row of attributes (the row either being selected randomly or specified through screener logic), index specific row-column values and place them in the free format question text? Thanks!
asked Aug 27, 2014 by bbedore (210 points)
retagged Aug 27, 2014 by Walter Williams

2 Answers

0 votes
Sounds to me like you could leverage  the ability within the CBC software to import a design file and show attribute levels within conjoint tasks.  Even if your questions are not conjoint questions, it will allow you to store your combinations in a file and retrieve them when needed.

Easiest way to do that it to create a dummy CBC study in SSI Web.  Then, let CBC generate an experimental design (which you'll replace with your own info).  Then, from the Design tab, Export CBC's design to a .CSV file.  Edit that file and replace with your own attribute combinations.  Then, click the Import button on the Design tab and import your combinations.

Then, within Free Format questions you can retrieve either values or labels associated with your design file using SSI Scripting instructions such as CBCDesignLevelValue or CBCDesignLevelText.  These instructions let you index certain task#, concept#, attribute# combinations.
answered Aug 27, 2014 by Bryan Orme Platinum Sawtooth Software, Inc. (133,865 points)
This sounds similar to a dilemma we were confronted with a short while ago. We did not have the conjoint programming skills available at the time so we imported the design model data as Merged data (sample) into Sawtooth and I used some fancy programming to display the variables from the design data in a Select type question. At the same time, I recorded a variable that indicated what was displayed to the respondent on each of the pages.

With the respondents answers and the variable telling us what was displayed on each of the pages, the analysis could be successfully performed.

Note - I performed this using a select question rather than a free format question, which is always an advantage.
Thanks, Bryan. Is it possible to index certain version#s as well with SSI scripting? I have 30 different combinations I'd like to randomly assign, so I was hoping I could generate a random # between 1 and 30, and then use that number to index a version of the CBC (i.e., Task and Concept will always be 1's and I'd like to just directly index from my unique list of 30 combinations).
0 votes
I do the same thing lot of time for my client. Because they request least fill for assigning CBC version.

I use array inside the perl script and store csv design with CBC version there. I used ssi least fill technique to assign CBC version to each respondent. Based on that version, called it's design and show to respondent.
answered Aug 28, 2014 by Rajesh Rana Gold (23,430 points)
...