Sub topic 2
Collecting perception data from customers
This chapter assumes you understand brand positioning, can read a 1 to 7 survey rating scale, and can run basic pandas code. The map you build is only as good as the data behind it, so collect that data carefully.
Collecting perception data
Ask customers to rate each brand on each attribute, using a 1 to 7 scale. Also ask for overall similarity: show pairs of brands and ask how alike they feel, from 1 (very different) to 7 (very similar). Randomize the brand order for each respondent to reduce order bias. Average the ratings per brand so that you have one row per brand.
Similarity scores point the wrong way for distance. Convert them to dissimilarity by computing 8 minus the score, so that high values mean "far apart."
Building a map from attribute ratings with PCA
Principal component analysis (PCA) finds the directions in which the data varies most. Standardize the ratings first so that no attribute dominates because of its scale. The first two components become the map axes.
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
ratings = pd.DataFrame(
{
"affordable": [6.1, 5.4, 2.3, 3.0, 4.2],
"premium": [2.0, 3.1, 6.4, 5.8, 4.0],
"innovative": [3.2, 5.9, 5.1, 2.5, 4.4],
"reliable": [5.0, 3.3, 5.6, 6.0, 4.1],
},
index=["Brand A", "Brand B", "Brand C", "Brand D", "Brand E"],
)
scaled = StandardScaler().fit_transform(ratings)
pca = PCA(n_components=2)
coords = pd.DataFrame(
pca.fit_transform(scaled), index=ratings.index, columns=["dim1", "dim2"]
)
loadings = pd.DataFrame(
pca.components_.T, index=ratings.columns, columns=["dim1", "dim2"]
)
print(coords.round(2))
print(loadings.round(2))
print(pca.explained_variance_ratio_.round(2))Building a map from similarity judgments with MDS
Multidimensional scaling (MDS) places items in a low-dimensional space so that their distances match a table of dissimilarities. Use MDS when customers judge overall similarity instead of rating attributes. Because MDS does not require attribute ratings, it does not tell you what the axes mean. You must interpret them afterward.
import numpy as np
from sklearn.manifold import MDS
brands = ["Brand A", "Brand B", "Brand C", "Brand D"]
dissimilarity = np.array(
[
[0.0, 2.0, 6.0, 5.0],
[2.0, 0.0, 5.5, 5.0],
[6.0, 5.5, 0.0, 1.5],
[5.0, 5.0, 1.5, 0.0],
]
)
mds = MDS(n_components=2, dissimilarity="precomputed", n_init=4, random_state=0)
coords = mds.fit_transform(dissimilarity)
for brand, (x, y) in zip(brands, coords):
print(f"{brand}: ({x:.2f}, {y:.2f})")
print("stress:", round(mds.stress_, 3))Naming the axes from loadings and attribute directions
A loading shows how strongly one attribute pulls on one axis. Read each axis by looking at its largest loadings and their signs. In the PCA output, if "affordable" and "premium" have large loadings of opposite sign on dim1, dim1 is a price-tier axis. Name it for the contrast, such as "budget to premium." Check that the names match the brands: the brands at each end should fit the label.
Exercise
In the PCA output, "affordable" has a loading of -0.6 on dim1 and "premium" has a loading of +0.6 on dim1. What should you call dim1, and why can you not name it from the MDS result alone?
Show answer
Call dim1 a price-tier axis, running from budget (negative) to premium (positive). MDS output contains only coordinates and no attribute loadings, so you must infer the axis meaning from which brands sit at each end.