When you have used Q to analyze data from a conjoint experiment, you can simulate the preference shares for different alternatives using R. This allows you to experiment with different combinations of attributes, like price and package size, to gain an understanding of how they affect preferences.
Method
The basic process is to first set up your choice model, then set up the scenario of different alternatives that you wish to compare, and finally to compute the shares for the alternatives you have chosen.
Creating your choice model
Create your choice model in Q by following the steps here: How to Do Choice Modeling in Q
In this article, I will use a choice model on the chocolate market, which asked respondents to make choices between alternatives where the Brand, Price, Sugar, Cocoa Strength, and other attributes were varied. The output of the model looks like this:
Create the scenario you want to test
You first need to decide which combinations of attributes from the choice model are to be compared and encode these scenarios as a list using R.
You need to have at least two alternatives being compared. If your conjoint experiment included a 'None of these' alternative then you can also include this. See below for more.
Each alternative should include a selection for at least one attribute. If you wish to ignore the effect of one or more attributes, say just focusing on brand and price, then you can leave them out of the specification of the scenarios. In this example, I will focus on simulating the effect of Brand and Price.
To create your scenario:
- Select Create > R Output.
- Paste in the R Code below.
- Modify the scenario to your choice model.
- Click Calculate.
scenario = list('Hershey' = list('Price' = '$1.49', 'Brand' = 'Hershey'),
'Lindt' = list('Price' = '$1.99', 'Brand' = 'Lindt'),
'Godiva' = list('Price' = '$2.49', 'Brand' = 'Godiva'))
Note that:
- There are three alternatives: Hershey, Lindt, and Godiva.
- The first part of each line (for example, 'Hershey') gives the name of the alternative and this determines how your alternative will be labeled in the preference shares output later on.
- For each alternative, there is a list of attributes and levels for that alternative. It is important that these labels match the contents of your choice model. For example both 'Price' and 'Brand' are names of attributes in the choice model, and '$1.49' and '$1.99' match the labels of levels of the price alternative in the model above.
The output of the scenario looks like this:
Note that if you don't include the same set of attributes for each alternative then this will no longer appear formatted as a table.
Create the preference shares
Finally, to compute the preference shares for this scenario we again use R.
- Select Create > R Output.
- Paste in the R code below.
- Modify the first two lines so that they refer to the names of the choice model output you wish to use and the scenario you created above.
choice.model = choice.model
scenario = scenario
n.resp <- dim(choice.model$respondent.parameters)[1]
resp.shares <- predict(choice.model,
scenario = scenario,
optimx.controls = list(abstol = 1e-7, maxit = 1000))
wgt <- if (is.null(QPopulationWeight)) rep.int(1L, n.resp) else QPopulationWeight
resp.shares <- sweep(resp.shares, 2, wgt, "*")
if (length(QFilter) == n.resp)
resp.shares <- resp.shares[, QFilter, , drop = FALSE]
pref.shares <- apply(resp.shares, c(1, 3), mean, na.rm = TRUE)
preference.shares <- pref.shares / SumEachRow(pref.shares) * 100
Note that if you wish to incorporate a weight or filter to this analysis then you can apply that directly to this R Output.
The output of the preference share calculation looks like this:
This tells us that among the three scenarios included, the preference share for the Hershey chocolate at a price point of $1.49 is 52%.
Including 'None of these' alternatives
Choice models can include 'None of these' alternatives, either by including a 'None of these' alternative in the experimental design, or by including a follow-up question for each task asking the respondent to indicate if they would actually purchase their most preferred alternative (referred to as 'dual-response none').
If you wish to include the 'None of these' as an alternative in the simulated preference shares then you can add an additional alternative in your scenario as follows:
scenario = list('Hershey' = list('Price' = '$1.49', 'Brand' = 'Hershey'),
'Lindt' = list('Price' = '$1.99', 'Brand' = 'Lindt'),
'Godiva' = list('Price' = '$2.49', 'Brand' = 'Godiva',
'None of these' = list('Alternative' = 'None of these')))