Getting Preferred Combination of Attributes With Conjoint Analysis

Sachin Last Updated : 12 Oct, 2024
6 min read

Introduction

We often have to decide between two or more options when there are some things we like about one option and some things we want about the other.

Now, if we think of all the companies trying to create successful products, they can’t afford to make educated guesses about choosing the most appealing features for the customers.

This is where a proven approach called conjoint analysis comes in.

This article will take us through the essential concepts of conjoint analysis. We will learn how to prepare a conjoint design, know the difference between different conjoint analysis survey techniques, understand the different conjoint analysis terminologies, implement conjoint analysis in Python, and interpret results to determine the best combination of attributes in a product.

So, let’s get started.

This article was published as a part of the Data Science Blogathon.

Table of Contents

What is Conjoint Analysis?

Conjoint analysis is a survey-based statistical technique to determine how customers value different attributes (features, functions, benefits) that constitute a product or a service. We must find which combination of a limited number of product or service attributes influences a consumer’s choice or decision-making. Conjoint analysis has several applications testing customer acceptance of new product designs, assessing the appeal of advertisements, and in service design, product-positioning.

Companies win over consumers by using the right features and charging the right price. For example, smartphone manufacturers are packing more and more capabilities into these tiny devices, with billions of dollars at stake, if they get the right combinations of features and price.

Hotels and resorts fine-tune their facilities and service levels to appeal to specific target markets, such as people traveling in business class or luxury vacationers.

Consumer packaged goods companies tweak their packaging, flavors, and nutritional contents to appeal to new customer segments and create successful line extensions.

Conjoint Design

We can describe a product or service in terms of several attributes further broken down into several levels. E.g., a Mobile Phone may have attributes like screen size, color, brand, price, and so on, and levels for screen size maybe 5 inches, 5.5 inches, or 6 inches.

Attributes should be relevant to managerial decision-making, have varying levels in real life (at least two levels), be expected to influence preferences, be clearly defined and communicable, and not exhibit strong correlations (price and brand are an exception).

Levels of attributes should be unambiguous, mutually exclusive, and realistic.

The profile is a unique combination of attribute levels.

"conjoint analysis

Types of Conjoint Analysis

Based on the response type of the survey questionnaire, conjoint analysis is classified as follows:

1. Ranking-based conjoint: Also called Preference-based conjoint analysis. Respondents rank the profiles from best to worst. It is similar to best-worst scaling, but respondents must allocate rankings to the intermediate options.

2. Rating-based conjoint: Also called Score-Based conjoint analysis. Respondents give ratings to the product profiles they are shown. Ratings can be on a scale of 0 to 5, 0 to 10, or 0 to 100. Respondents must allocate scores so that the scores add up to a certain number (e.g., all scores in each question must add up to 100).

3. Choice-based conjoint: Respondents choose which option to buy or otherwise select. The choice-based method is the most theoretically sound, practical, and common practice.

Conjoint Analysis Process

1. Describe your research objective and the target product. List down the research questions to answer.

2. Create the combination or product profiles (Specify Attributes & Levels).

3. Select the controlled set of “product profiles” or “combination of attributes & levels” for the consumer to choose from.

4. Design the Questionnaire (Based on the abovementioned types) and collect responses.

5. Perform conjoint analysis

6. Report and Interpret results

Implementing Conjoint Analysis

Let’s take the example of pizza. We want to understand which combination of attributes & levels is most and least preferred by customers while choosing or ordering pizza so that the marketing team can enter the market with the best combinations.

The first step is to define the attributes and levels of the product.

We will take eight different attributes, namely ‘brand,’ ‘price,’ ‘weight,’ ‘crust,’ ‘cheese,’ ‘size,’ ‘toppings,’ and ‘spicy,’ where brand, price, and weight have four levels each and rest of the attributes have two levels.

"

The next step is to select the number of combinations or profiles. Here, we have a total 4*4*4*2*2*2*2*2 number of combinations. But we will not use all combinations since the company may not be able to produce some combinations, and the customers may not prefer some combinations. So, we will go with the selected 16 combinations and their rankings from a survey. We will load the dataset in the proper format.

Python Code:

import pandas as pd
df=pd.read_csv('pizza_data.csv')
print(df)

We will now estimate each attribute level’s effects using Linear Regression Model.

import statsmodels.api as sm
import statsmodels.formula.api as smf

model='ranking ~ C(brand,Sum)+C(price,Sum)+C(weight,Sum)
       +C(crust,Sum)+C(cheese,Sum)+C(size,Sum)+C(toppings,Sum)+C(spicy,Sum)'
model_fit=smf.ols(model,data=df).fit()
print(model_fit.summary())
conjoint analysis

We can analyze the model’s fitness using parameters like R-squared, p-values, etc. The coefficients of each attribute level define its effect on the overall choice model.

Now, we will create the list of conjoint attributes.

conjoint_attributes = ['brand','price','weight','crust','cheese','size','toppings','spicy']

Before going ahead, we need to understand these conjoint analysis terminologies:

Relative importance: It depicts which attributes are more or less important when purchasing. E.g., a Mobile Phone’s Relative importance could be Brand 30%, Price 30%, Size 20%, Battery Life 10%, and Color 10%.

Part-Worths/Utility values: The amount of weight an attribute level carries with a respondent. These factors lead to a product’s overall value to consumers.

Next, we will build part-worths information and calculate attribute-wise importance level.

level_name = []
part_worth = []
part_worth_range = []
important_levels = {}
end = 1  # Initialize index for coefficient in params

for item in conjoint_attributes:
    nlevels = len(list(np.unique(df[item])))
    level_name.append(list(np.unique(df[item])))
    
    begin = end
    end = begin + nlevels -1
    
    new_part_worth = list(model_fit.params[begin:end])
    new_part_worth.append((-1)*sum(new_part_worth))
    important_levels[item] = np.argmax(new_part_worth)
    part_worth.append(new_part_worth)
    print(item)
    #print(part_worth)
    part_worth_range.append(max(new_part_worth) - min(new_part_worth))
    # next iteration
print("-------------------------------------------------------------")
print("level name:")
print(level_name)
print("npw with sum element:")
print(new_part_worth)
print("imp level:")
print(important_levels)
print("part worth:")
print(part_worth)
print("part_worth_range:")
print(part_worth_range)
print(len(part_worth))
print("important levels:")
print(important_levels)
CODE OUTPUT

Now, we will calculate the importance of each attribute.

attribute_importance = []
for i in part_worth_range:
    #print(i)
    attribute_importance.append(round(100*(i/sum(part_worth_range)),2))
print(attribute_importance)
"

Now, we will calculate the part-worths of each attribute level.

part_worth_dict={}
attrib_level={}
for item,i in zip(conjoint_attributes,range(0,len(conjoint_attributes))):
    print("Attribute :",item)
    print("    Relative importance of attribute ",attribute_importance[i])
    print("    Level wise part worths: ")
    for j in range(0,len(level_name[i])):
        print(i)
        print(j)
        print("          {}:{}".format(level_name[i][j],part_worth[i][j]))
        part_worth_dict[level_name[i][j]]=part_worth[i][j]
        attrib_level[item]=(level_name[i])
        #print(j)
part_worth_dict
code output
conjoint analysis

In the next step, we will plot the relative importance of attributes.

plt.figure(figsize=(10,5))
sns.barplot(x=conjoint_attributes,y=attribute_importance)
plt.title('Relative importance of attributes')
plt.xlabel('Attributes')
plt.ylabel('Importance')
conjoint analysis

We can see that weight is the attribute with the highest relative importance at 51%, followed by crust at 16% and toppings at 10%. Brand, cheese, and size are the least important attributes, each at 2.38%.

Now, we will calculate the utility score for each profile.

utility = []
for i in range(df.shape[0]):
    score = part_worth_dict[df['brand'][i]]+part_worth_dict[df['price'][I]]
            +part_worth_dict[df['weight'][i]]+part_worth_dict[df['crust'][i]]
            +part_worth_dict[df['cheese'][i]]+part_worth_dict[df['size'][I]]
            +part_worth_dict[df['toppings'][i]]+part_worth_dict[df['spicy'][i]]
    utility.append(score)
    
df['utility'] = utility
utility
"

Plotting the utility score

"conjoint analysis

We can see that combination number 9 has the maximum utility, followed by combination numbers 13 and 5. Combination number 14 is the least desirable because of the most negative utility score.

Now, we will find the combination with maximum utility.

print("The profile that has the highest utility score :",'\n', df.iloc[np.argmax(utility)])
code output

Now, we will determine the levels being preferred in each attribute.

for i,j in zip(attrib_level.keys(),range(0,len(conjoint_attributes))):
    #print(i)
    #level_name[j]
    print("Preferred level in {} is :: {}".format(i,level_name[j][important_levels[i]]))
code output

Conclusion

Conjoint analysis is a type of statistical analysis used in market research to determine how customers value various components or qualities of a company’s products or services. It is founded on the idea that any product can be broken down into a set of features that ultimately influence users’ perceptions of an item or service’s value.

  • Conjoint analysis is an effective technique for extracting consumer preferences during the purchasing decision.
  • An effective conjoint design requires properly defined product attributes and levels and choosing the limited number of profiles or combinations of attributes & levels to be presented to the survey respondents.
  • The profile preference response can be collected in different ways, i.e., ranking-based, rating-based, or choice based.
  • The conjoint analysis involves the evaluation of the linear regression model, part-worth calculation, and analysis of utility score and relative importance of features to determine the best product profile.

The media shown in this article is not owned by Analytics Vidhya and is used at the Author’s discretion.

I am an MBA (Business Analytics) student. Highly enthusiastic about learning Machine learning and its use case across industries. I strongly believe in knowledge sharing and follow the same through my articles on Analytics Vidhya.

Responses From Readers

Congratulations, You Did It!
Well Done on Completing Your Learning Journey. Stay curious and keep exploring!

We use cookies essential for this site to function well. Please click to help us improve its usefulness with additional cookies. Learn about our use of cookies in our Privacy Policy & Cookies Policy.

Show details