This article explains how to automatically transform a standard Alida MaxDiff data export into a structure that can be analyzed in Displayr using Hierarchical Bayes or Latent Class Analysis.
Alida MaxDiff data is exported with one row per task and one variable for each alternative shown in that task:
The process outlined in this article transforms the Alida data by creating:
- A MaxDiff design matrix
- A respondent-level dataset with Most/least preferred variables for each task
This is the structure needed to run a MaxDiff analysis in Displayr.
Requirements
- A standard Alida MaxDiff data export.
Method
Step 1 - Import the Alida MaxDiff dataset into Displayr
Import your Alida MaxDiff data export into Displayr as you would any other dataset.
Step 2 - Create a Version variable
Next, we'll create a Version variable that assigns an incrementing version number to each respondent. This will be used to create the design and will also be included in the respondent-level dataset. We do this using a JavaScript variable:
- Under Data Sources, hover over a variable and select + > Custom Code > JavaScript > Numeric.
- In Properties
, go to Data > JavaScript Code and tick the Access all data rows option.
- Go to the General tab of Properties
and change the Label and Name to
Version. - Enter the code below into the Code
panel.
- Click the Calculate button.
var result = new Array();
var version = 1;
var lastID = MemberID[0];
for (var i = 0; i < N; i++) {
if (MemberID[i] != lastID) {
version++;
lastID = MemberID[i];
}
result[i] = version;
}
resultStep 3 - Create the MaxDiff design
This step generates the MaxDiff design matrix from the Alida data:
- Download the design template.
- Upload the design template to your Displayr Cloud Drive.
- In the Report tree, select + > Template and select the 'Alida MaxDiff Design' template from your Cloud Drive. This will create an output in your Report tree called
md.design.widget. - In the
md.design.widgetProperties, select the following inputs:
-
Version - select the
Versionvariable created in Step 2. - Variables - select each of the alternative variables from the Alida MaxDiff dataset.
-
Not shown label - "Did not see" is the standard label in Alida MaxDiff of the alternatives that were not shown to respondents in a given task. You can verify this by selecting any of the alternative variables and, in Properties
, click Values and Labels to see each of the category labels.
-
Version - select the
- Click Calculate to generate the design output.
Step 4 - Create the most/least preferred dataset
This step generates the respondent-level most and least preferred variables for each task.
- Download the data transformation template.
- Upload the data transformation template to your Displayr Cloud Drive.
- In the Report tree, select + > Template and select the 'Alida MaxDiff Data Transform' template from your Cloud Drive. This will create an output in your Report tree called
md.data.widget. - In the
md.data.widgetProperties, select the following inputs:
- MemberID - the respondent identifier variable.
-
Version - the
Versionvariable created in Step 2 above. - Variables - the alternative variables from your Alida dataset.
- Most attribute label - the label used in Alida for the most preferred attribute.
- Least attribute label - the label used in Alida for the least preferred attribute.
- Output file name - the name for the output file (this will be saved to your Displayr Cloud Drive) automatically.
- Click Calculate to generate and save the most/least dataset to your Cloud Drive.
Step 5 - Import the respondent dataset
Import the most/least respondent-level dataset from your Displayr Cloud Drive:
- Under Data Sources, select + > Cloud Sources > Displayr Cloud Drive.
- Locate and select the respondent-level file created in Step 4 above.
- Click OK.
Step 6 - Run the MaxDiff analysis
With the design and most/least variables in place, you are ready to run the MaxDiff:
- In the Report tree, select + > Advanced Analysis > MaxDiff, then select either Hierarchical Bayes or Latent Class Analysis.
- In the
max.diffProperties, select the following inputs:
-
Design - select the
md.design.widgetfrom the design output created in Step 3 above. -
Add alternative labels - click this button to enter labels for each alternative starting in Cell A2.
Tip: Copy and paste the labels from Data Sources by selecting all of the alternative variables in the original Alida dataset, then right-click and select Copy Labels. -
Version - select the
Versionvariable from the respondent most/least dataset. - Best selections - select the most1, most2, most3, etc.
- Least selections - select the least1, least2, least3, etc.
-
Design - select the
- Click Calculate.
Next
How to Perform an Advanced Analysis of Experimental Data (MaxDiff)