Before using this QScript you must:
- Convert the .CHO file to an Excel file. See below for instructions.
- Import a survey data file in to Q. This file must contain IDs for each individual (or respondent) which match those from the choice data in the CHO file.
The QScript will add the data from the CHO file to your survey data so that you can analyse the results of the experiment together with the other data that has been collected from the individuals. In Q 4.11.11 and later you do not need to have a survey data file, and you can create a Q Project from the CHO file directly by running this QScript in a new Q window.
When you run this script you will be prompted to:
- Select the Excel file which contains the CHO data.
- (Optional) Select an Excel file which contains the labels for the attributes that were asked about in the conjoint experiment.
- Choose whether or not to add alternative-specific constants.
- Select the variable which contains the individuals' IDs.
Technical details
This QScript requires that you have two different files:
- An Excel file containing the data from a Sawtooth CHO format file. See below for how to convert the CHO file to an Excel file.
- A survey data file that the Experiment question will be added to. See below for the minimum requirements of this file. In Q 4.11.11 and later versions this file is no longer required, and the choice data can be added using only the CHO file.
Begin with your survey data file imported into a Q project, and then run this QScript.
Each task shown to the individuals should have the same number of alternatives, and each alternative should contain the same set of attributes.
Converting the CHO File
The CHO file produced by Sawtooth is a plain text file that can be opened in Excel. Follow the steps below to convert the CHO file into a file that Q can read.
- Open the .cho file in Excel
- In the Text Import Wizard, select Original Data Type > Delimited. Make sure Start at import row is 1 and that My data has headers is NOT ticked.
- Click Next.
- Select Delimiters > Space and deselect all other options.
- Click Finish.
- Use File > Save As and save the file as an Excel Workbook (.xlsx format).
The importing options in Excel look like those shown in the picture below.
Once in the correct format, the Excel file should look like the following example.
Survey Data File
The data file in your project needs to contain at least one variable which contains the individuals' IDs.
Attribute Labels
The file containing the labels for the levels should contain one column for each attribute, with the labels of each level for that attribute labeled in order. For example:
If no file is specified then the attribute levels will be labeled with the numbers as they appear in the experimental design. These can be changed later by highlighting the variables for a single attribute in the Variables and Questions tab and editing the Values (...) to update the labels.
Extra Variables
In addition to the experimental design and choices made by the individuals, CHO files can also contain additional variables (e.g. the duration of the survey, or demographic or segmentation variables). These can also be imported along with the experiment, and you will be given the option of importing them when you run the script. CHO files do not contain any metadata (labels, variable type, etc) for these variables, and so they will initially appear as Numeric variables in Q.
None of These Options
Sawtooth experiments can contain a dual-response option, where the individual is asked to choose which alternative they prefer, and subsequently asked whether they would actually purchase that alternative. Q does not support this kind of experiment.
How to apply this QScript
- Start typing the name of the QScript into the Search features and data box in the top right of the Q window.
- Click on the QScript when it appears in the QScripts and Rules section of the search results.
OR
- Select Automate > Browse Online Library.
- Select this QScript from the list.
Customizing the QScript
This QScript is written in JavaScript and can be customized by copying and modifying the JavaScript.
Customizing QScripts in Q4.11 and more recent versions
- Start typing the name of the QScript into the Search features and data box in the top right of the Q window.
- Hover your mouse over the QScript when it appears in the QScripts and Rules section of the search results.
- Press Edit a Copy (bottom-left corner of the preview).
- Modify the JavaScript (see QScripts for more detail on this).
- Either:
- Run the QScript, by pressing the blue triangle button.
- Save the QScript and run it at a later time, using Automate > Run QScript (Macro) from File.
Customizing QScripts in older versions
Next
- QScript for more general information about QScripts.
- QScript Examples Library for other examples.
- Online JavaScript Libraries for the libraries of functions that can be used when writing QScripts.
- QScript Reference for information about how QScript can manipulate the different elements of a project.
- JavaScript for information about the JavaScript programming language.
- Table JavaScript and Plot JavaScript for tools for using JavaScript to modify the appearance of tables and charts.