Conjoint Simulator

Introduction

The market simulator is usually considered the most important tool resulting from a conjoint analysis project. The simulator converts raw conjoint (part-worth utility) data into something much more managerially useful: simulated market choices.

Products can be introduced within a simulated market scenario and the simulator reports the percentage of respondents projected to choose each product. A market simulator allows an analyst or manager conduct what-if games to investigate issues such as new product design, product positioning, and pricing strategy.

For a more detailed overview of what a Market Simulator is, please refer to Chapter 10: Market Simulators for Conjoint Analysis in the introductory book Getting Starts with Conjoint Analysis (Orme 2014)

How does a Market Simulator work?

How does a market simulator work? Let us suppose we could quantify to what extent people liked various flavors of ice cream. Let us refer to those preferences as utilities and assume the following values for a given respondent:

Flavor Utility Price Utility
Chocolate 0 $0.60 50
Vanilla 30 $0.80 25
Strawberry 40 $1.00 0

Using these utility values, we can predict how this respondent would choose between a vanilla cone for $0.80 or a strawberry cone for $1.00:

- Vanilla (30 utiles) + $0.80 (25 utiles) = 55 utiles
- Strawberry (40 utiles) + $1.00 (0 utiles) = 40 utiles

We predict that this respondent will prefer the vanilla cone. Now suppose we had data for not just one, but 500 respondents. We could count the number of times each of the two types of cones was preferred, and compute a share of preference, also referred to as a share of choice. If 300 respondents are predicted to choose the vanilla cone for $0.80 and 200 respondents are predicted to choose the strawberry cone for $1.00, then we would obtain these shares of preference or choice:

Product Concept Share of Preference
Vanilla at $0.80 300/500 * 100% = 60%
Strawberry at $1.00 200/500 * 100% = 40%

In it’s simplest form, a simulator assumes respondents buy or choose the product alternative from the competitive set that has the highest total utility, as determined by summing the part-worth utilities associated with the levels describing each product.

Creating a Market Simulator at Gradient

While we’ve dabbled with Excel simulators in the past, it didn’t really hit the mark. It was hard to edit and even harder for clients to use. Since then we’ve moved on to delivering online dashboards for our clients using the DisplayR platform. While DisplayR can do a lot of different things we really only use it for our conjoint simulators at the moment.

Since we estimate our own models, and don’t use the DisplayR platform to create the design and analysis, we need to build the simulator by hand, rather than using their native features. Thankfully, they have a handy tutorial for us to follow. Our earliest simulators followed this to a T, but we have since improved on the tutorial to include more features.

Refer to this basic example simulator, created for the tutorial by DisplayR as a starting point.

Please refer to the video below to accompany the written tutorial on this page.

Getting Started

Log in and navigate to the Templates folder, then:

  • If your simulator should compare concepts with a None, hover over the Template: Conjoint Simulator - No None, press the three dots (...) and Duplicate the file.
  • If your simulator should compare multiple concepts against each other without a None option, select the Template: Conjoint Simulator and duplicate it.

Move your duplicated file, rename and move it to a new folder.

Uploading your data

In order to get the data in the right format, we created a function* that takes the data created by our models and transforms it into a wide dataframe.

First, apply this function to your model and append all demographic / profiling data for filtering or weighting purposes. Export the dataset as a .csv and upload it on DisplayR with the + sign in the Datasets tab.

  • The attribute & utility combination are separated by a colon (:) in the variable name, which allows DisplayR to learn that it’s part of a variable set. Sometimes, the parsing isn’t done correctly, and you may need to combine or split variables manually. The structure of the conjoint variables should be Numeric - Multi.

We recommend keeping the templated dataset in the dashboard until everything is adjusted. It helps with understanding how the template is built up.

Changing the Layout and other Aesthetics

DisplayR is a dashboard builder, meaning plenty of design tools are available. We advise to either brand the simulator in a default Gradient style or to the client’s specific style guide.

For more tutorials, visit the Design Your Report page on DisplayR.

In this stage, we recommend doing the following things:

  • Update & duplicate the number of attributes and control boxes until you reach your study’s requirements
  • Move the market share ribbon and background so that everything fits on the page
  • Adjust logo, title, colors etc.
  • Rename page title on the left

Updating Control Boxes

Each control boxes represents the selected levels for the attribute in a profile. There are two things you need to adjust and set up correctly for each of the control boxes:

  • name - When selecting a control box, the Properties tab on the right will show the current Name. Make sure that this name reflects the attribute name, and has a number attached to it so you can keep track of it. Generally, I give it the following structure: variable_name.[#]
  • items - The items it can take and display. By default, you can use the Items From and select the attribute dataset to select the items from. This is by far the easiest and safest way, as it selects the exact match between the names when you select an item. It is however still possible to manually put in your list of items in the item list entry. Separate your levels with a comma (,).

You must repeat this process for all control boxes until everything has a name and proper item list.

Updating Market Share Calculation

While adjusting the control boxes, you may have noticed that the calculations stopped working. Now that the dataset is uploaded and the control boxes are set up, we need to update the calculation in the market share boxes at the bottom of the simulator.

The beautiful thing about DisplayR is, as the name suggests, that you can write R code and have it interact with the dashboard. In our case, we’re going to write R code to compute the market share of each of the profiles.

Select the first market share box at the bottom, and inspect the R code. You’ll see something along these lines:

u1 = `nightshift_cjt_displayr.csv`$Questions$second_device[, second_device.1] + 
  `nightshift_cjt_displayr.csv`$Questions$service[, service.1] +
  `nightshift_cjt_displayr.csv`$Questions$pricing_scenario[,pricing_scenario.1] 

u2 = `nightshift_cjt_displayr.csv`$Questions$second_device[, second_device.2] +
  `nightshift_cjt_displayr.csv`$Questions$service[, service.2] +
  `nightshift_cjt_displayr.csv`$Questions$pricing_scenario[,pricing_scenario.2] 

u3 = `nightshift_cjt_displayr.csv`$Questions$none

# Computing preference 
utilities = as.matrix(cbind(u1, u2, u3))
eutilities = exp(utilities)
shares = prop.table(eutilities, 1)
# Filtering the shares, if a filter is applied.
shares = shares[QFilter, ]
# Filtering the weight variable, if required.
weight = if (is.null(QPopulationWeight)) rep(1, length(u1)) else QPopulationWeight
weight = weight[QFilter]
# Computing shares for the total sample
shares = sweep(shares, 1, weight, "*")
shares = as.matrix(apply(shares, 2, sum))
shares = 100 * prop.table(shares, 2)[1]
results = paste0(round(shares,1), '%')

results

There really is only one part of this code that you need to adjust, which is highlighted below. This section combines the utilities for your selection for your profile. Note the .1 and .2 at the end for each of the utility combinations. A few things to note while adjusting this section:

  • Update the dataset.csv name to reflect your new upload
  • Make sure you create a line for all of your attributes
  • When you copy and paste, make sure that the digits at the end reference the correct input box
  • Make sure that when you compute the market share for the second, third or N profile, you replace the last value in the shares = 100 * prop.table(shares, 2)[1] line with the corresponding value (e.g., 1 for first share, 2 for second, 3 for third etc.)
u1 = `nightshift_cjt_displayr.csv`$Questions$second_device[, second_device.1] +
  `nightshift_cjt_displayr.csv`$Questions$service[, service.1] +
  `nightshift_cjt_displayr.csv`$Questions$pricing_scenario[,pricing_scenario.1] 

u2 = `nightshift_cjt_displayr.csv`$Questions$second_device[, second_device.2] +
  `nightshift_cjt_displayr.csv`$Questions$service[, service.2] +
  `nightshift_cjt_displayr.csv`$Questions$pricing_scenario[,pricing_scenario.2] 

u3 = `nightshift_cjt_displayr.csv`$Questions$none

Adding Filters

As you may have seen in the previous section, the market share code is optimized to use filters. When you upload a dataset, the variables you’d like to use as filters aren’t optimized yet. In order to make them so, your variables need to be Binary - Multi: Non-mutually exclusive categories. Fortunately, DisplayR makes it easy to transform your variables.

  1. Click on the variable(s) you’d like to create filters from
  2. Go to Anything -> Filter -> Filter(s) from selected data
  3. Click on the newly created variable set(s) and rename the main variable to what you want to call your filter
  4. Make sure your variable has the Usable as filter box checked

Adding Weights

Similar to the filters, the calculation code is optimized to work with a global weight. However, unlike filters, it’s a little less straightforward to allow the user to turn weights on and off. If you always want the weights to be on, you can simply select the weight variable (should be a numeric variable) and press the Usable as a weight on the properties tab.

However, if you want the user to be able to select and unselect the weight box, we’ll need to take a few additional steps.

  1. Create a new control box somewhere on the page. Call it something like weight_box
  2. Manually input the options, e.g., “Weight On” and “Weight Off”
  3. Create a new numeric variable based on R code by going to Data -> Variables -> New -> Custom Code -> R - Numeric.
  4. In the R Code box, enter something like the below:
if (weight_box == "Weight On") `weights` else
if (weight_box == "Weight Off") rep(1, length(picasso_weights.csv$Variables$response_id))
  1. You can see that the weights will be set to 1 if it’s off, and will duplicate the values of the weight variable if on
  2. Make sure that this variable is Usable as a weight and the original weight variable is not usable as a weight

Using Custom R Code

As mentioned before, DisplayR allows you to run R code and have the dashboard interact with the results. This happens in near real-time, making it extremely useful. In order to use custom R code, press the Calculation -> Custom Code and drag the box anywhere on your dashboard.

  • If your custom code should output a value, string, or anything else that should be displayed to the users, drag it to the right place and make sure the output is visible
  • If your custom code should only create something on the back-end to use, and shouldn’t be visible to the users, drag it outside of the dashboard area and press Hidden from exported views in the Properties tab.
    • Additionally, it’s useful to select Include R code: Only output code in the Output dropdown in the properties tab. This way you can see the code that it’s executing.

Remember to give the box a name. This is the variable that your output will be assigned to.

Adding Conditionality

An example of using custom R code can be found directly in the template. For this study, we had some built-in conditionality. A few levels of the Service attribute were restricted to the selected Tier attribute.

I created two R boxes below the dashboard, respectively called service_options_1 and service_options_2. The code, as seen below, gives us the appropriate service options based on the selected tier. Make sure to update the items list in the Service box to take the values from the R output (in this case, the variable called service_options_1). Remember to hide the output from exported views!

## Dropdown items for Service 1 ##
if(tier.1 == "Basic Plan"){
  "No Service"
} else if(tier.1 == "Standard Plan"){
     c( "iCloud 2TB",
        "Apple Music", 
        "Apple TV + Arcade",
        "Apple Care + iCloud 2TB",
        "Standard Accessory Package ")
} else if(tier.1 == "Pro Plan"){
     c( "Apple One Premier",
        "Apple One Individual + Apple Care",
        "Premium Accessory Package")
}

Publishing your Dashboard

Feel free to publish your dashboard when you’re ready (or when you want to test). You can do so by selecting Publish -> Export to Web from the ribbon at the top. By default, the Login and password required is selected and should be so for every client project. Administrators (Gradient employees) will have access by default, but client users must be invited.

Click on Republish if you want to republish the changes you made.

See the live dashboard for our template project here

Adding Users & Access Restrictions

One of the most tedious things about DisplayR is adding users. It’s not very straightforward, which is why this section is very important.

  1. First, Press the user icon in the top right (👤) and press Account settings
  2. Go to the Settings tab
  3. Optional: If your project is for a new client, scroll down to the Groups section and create a + New Group.
  4. Scroll to the User section and create + New User
    1. Enter their full name and email

    2. Select the group you just created or an existing group the user belongs to.

Do not select administrators under any circumstance. This designation is reserved for Gradient employees and provides access to all our dashboards
Note: This will send an email to the user right away, so only invite users if the dashboard is entirely ready to share
  1. Navigate to all projects, hover over your dashboard end press the three dots (...) and press Settings
  2. Click on the Properties tab and select the groups that should have either view only access or view and edit access.
    1. Press CTRL + click if you want to select multiple groups.

That’s it. Your dashboard is now live and ready to view by your clients.