Example
The table below shows the output of a 5-class latent class analysis using MaxDiff data on technology companies. The distribution of respondent parameters is displayed for each alternative, with blue and red columns corresponding to positive and negative parameters respectively:
The Design input table needs to be in a form similar to the one shown below. The 'Version' column is optional when there is only one version in the design. The 'Question' column is also optional. However, if these columns are included, they must have the names 'Version' and 'Question'. The columns after this contain the indices of the alternatives presented to the respondents.
Data Setup
The respondent MaxDiff choices can be stored as either the alternative number or the option number. The alternative number represents the number of alternatives analyzed in the experiment, for example, if there were 10 alternatives, the values 1-10 would be stored in the best/worst variables as show here:
When the option number is captured instead of the alternative number, the the number of the option selected is used instead of the alternative number. For example, if 5 alternatives were shown to respondents for each question, then the values 1-5 are stored in the best/worst variables as shown below:
Note that when the data is setup based on option number, the Question Type for the respondent MaxDiff selections should be set to Number or Number - Multi, unless the MaxDiff Experimental design includes Alternative labels.
Options
The inputs used to generate the Latent Class Analysis are shown below.
Experimental Design
Design location One of,
-
- Use an existing table Select an existing table in the project in Design.
- Experimental design R output Select a MaxDiff design created with Marketing - MaxDiff - Experimental Design.
- Variables Provide Alternatives (and optionally Design version) where each alternative contains the alternatives presented by question, analogous to the columns of a tabular design.
- Provide a URL Enter a URL in Design URL.
Design The design table. This may contain a 'Version' column and if not present there is assumed to be one version. It may also contain a 'Question' column. All other columns are assumed to contain the alternatives presented, hence the number of other columns defines the number of alternatives per question.
Design URL The URL to a CSV file containing the design.
Alternative labels Labels for the alternatives specified in the first column of the data editor. This can be left out in most cases as the alternatives can usually be extracted from the best and worst selections.
Respondent Data
Version A variable which indicates which version of the design was provided to each respondent. Can be left blank if the design only contains one version.
Best selections The best selections for each question. Can be categorical variables with labels matching the labels in the design; categorical variables containing the selected option value (e.g. "Option 1", "Option 2", "Option 3" for a design with three alternatives shown per question); numeric variables taking values from 1, 2, ..., up to the number of alternatives; or numeric variables taking values from 1, 2, ..., up to the number of options shown per question.
Worst selections The worst selections for each question. Should have the same format as Best selections.
Missing data See Missing Data Options.
Model
Type Switch between MaxDiff models: Latent Class Analysis, Hierarchical Bayes and Varying Coefficients.
Number of classes The number of classes in the analysis.
MaxDiff logit Choose between Tricked Logit and Rank-Ordered Logit with Ties. The former is faster but the latter is used in Segments > Latent Class Analysis for MaxDiff in Q.
Questions left out for cross-validation The number of questions to leave out per respondent to be used for cross-validation.
Seed The random seed used to determine the random initial parameters of the model and also used to determine the random questions to leave out for cross-validation.
Number of starts The number of times to run LCA with different initial parameters, where the final model is the one with the best log-likelihood.
DIAGNOSTICS
Class Parameters Table Create a table showing parameters by class.
Class Preference Shares Table Create a table showing preference shares by class.
Parameter Statistics Table Creates a table showing the parameter statistics for the model.
SAVE VARIABLE(S)
Sawtooth-Style Preference Shares (K Alternatives) Saves variables that contain Sawtooth-style preference shares (K alternatives).
Save class membership Saves a variable that contains the predicted class (segment) of each respondent.
Save class membership probabilities Saves variables that contain the class membership probabilities from a latent class model.
Individual-Level Coefficients Saves variables that contain the individual-level coefficients (utilities).
Preference Shares Saves variables that contain preference share for each alternative by respondent.
Proportion of Correct Predictions Save a variable that contains the proportion of correct 'best' predictions for each respondent.
RLH (Root-Likelihood) Saves a variable that contains the root likelihood for each respondent.
Zero-Centered Utilities Saves variables that contain the zero-centered utilities.
Additional Properties
When using this feature you can obtain additional information that is stored by the R code which produces the output.
- To do so, in Q select Create > R Output and in Displayr select Calculation > Custom Code
- In the R CODE, paste: item = YourReferenceName
- Replace YourReferenceName with the reference name of your item. Find this in the Report tree or by selecting the item and then going to Properties > General > Name from the object inspector on the right.
- Below the first line of code, you can paste in snippets from below or type in str(item) to see a list of available information.
For a more in depth discussion on extracting information from objects in R, checkout our blog post here.
Properties which may be of interest are:
- The proportion of total sample assigned to each class:
-
- item$class.sizes # class membership sample proportions
- The overall brand preference shares by class segment"
-
- item$class.preference.shares # class brand preference shares
Technical Details
The parameters are scaled to sum to zero after estimation (the parameters for the first alternative are constrained to zero during estimation).
Next
Displayr: How to Do MaxDiff Latent Class Analysis
Q: How to Do MaxDiff Latent Class Analysis in Q