################################################################################
## Perceptual mapping and Product Positioning using R (Under development)
## by Dr. Jimmy (Zhenning) Xu,
## follow me on Twitter https://twitter.com/MKTJimmyxu
################################################################################
Perceptual maps, also known as market maps, are effective in developing new products and product positioning and can be easily used by managers in developing actions. A Perceptual Map is a way of visualizing the competitive battlefield. Two dimensions are identified that are the most important differentiators from.
R is my favorite tool. The following article shows an excellent R demo: https://www.r-bloggers.com/the-unavoidable-instability-of-brand-image/
For the first section, you will need the package ‘psych’ installed. For the menu-driven option, go to the Tools drop down menue and select “Install Packages” Menu in the Menu bar, click on ‘Install Package(s)…’, a window will open asking which server to download the package from. Just choose any other country although I recommend that you choose the Cloud option.
A second window will open listing all the packages in R (at present, this list grows every month) in alphabetical order. Click on the package you want and sit back. R will automatically download and install the package for you. It might take a minute or two at most.
Well, either simply type:
install.packages(“psych”)
setwd("C:/Users/xzhenning/Documents/R/fall 2018") #identifying your working directory
#install.packages("psych")
library("psych")
df <- read.csv("blackberry.csv", header=TRUE, row.names=1)
pc.cr <- princomp(df, cor=TRUE)
summary(pc.cr)
## Importance of components:
## Comp.1 Comp.2 Comp.3 Comp.4 Comp.5
## Standard deviation 1.5734376 1.1920202 1.0166699 0.7863054 0.57932347
## Proportion of Variance 0.4126177 0.2368187 0.1722696 0.1030460 0.05593595
## Cumulative Proportion 0.4126177 0.6494363 0.8217060 0.9247520 0.98068793
## Comp.6
## Standard deviation 0.34040036
## Proportion of Variance 0.01931207
## Cumulative Proportion 1.00000000
biplot(pc.cr)
#install.packages("plfm")
library(plfm)
## Loading required package: sfsmisc
## Loading required package: abind
data(car)
str(car)
## List of 4
## $ datalongformat:'data.frame': 29484 obs. of 6 variables:
## ..$ IDobject : num [1:29484] 1 1 1 1 1 1 1 1 1 1 ...
## ..$ objectlabel : Factor w/ 14 levels "Audi A4","BMW X5",..: 13 13 13 13 13 13 13 13 13 13 ...
## ..$ IDattribute : num [1:29484] 1 2 3 4 5 6 7 8 9 10 ...
## ..$ attributelabel: Factor w/ 27 levels "Agile","Attractive",..: 5 1 6 19 18 8 26 9 12 20 ...
## ..$ IDrater : num [1:29484] 1 1 1 1 1 1 1 1 1 1 ...
## ..$ rating : num [1:29484] 1 0 0 1 1 1 1 1 0 0 ...
## $ data3w : num [1:78, 1:14, 1:27] 1 0 0 0 0 1 0 1 1 0 ...
## ..- attr(*, "dimnames")=List of 3
## .. ..$ : NULL
## .. ..$ : chr [1:14] "Volkswagen Golf" "Opel Corsa" "Nissan Qashgai" "Toyota Prius" ...
## .. ..$ : chr [1:27] "Economical" "Agile" "Environmentally friendly" "Reliable" ...
## $ freq1 : num [1:14, 1:27] 29 49 7 42 1 21 17 21 16 2 ...
## ..- attr(*, "dimnames")=List of 2
## .. ..$ : chr [1:14] "Volkswagen Golf" "Opel Corsa" "Nissan Qashgai" "Toyota Prius" ...
## .. ..$ : chr [1:27] "Economical" "Agile" "Environmentally friendly" "Reliable" ...
## $ freqtot : num [1:14, 1:27] 78 78 78 78 78 78 78 78 78 78 ...
## ..- attr(*, "dimnames")=List of 2
## .. ..$ : chr [1:14] "Volkswagen Golf" "Opel Corsa" "Nissan Qashgai" "Toyota Prius" ...
## .. ..$ : chr [1:27] "Economical" "Agile" "Environmentally friendly" "Reliable" ...
car$freq1
## Economical Agile Environmentally friendly Reliable
## Volkswagen Golf 29 40 20 58
## Opel Corsa 49 36 16 25
## Nissan Qashgai 7 10 5 18
## Toyota Prius 42 10 51 27
## BMW X5 1 15 2 38
## Volvo V50 21 11 16 49
## Renault Espace 17 9 7 17
## Citroen C4 Picasso 21 15 12 17
## Ford Focus Cmax 16 22 6 33
## Mercedes C-class 2 17 5 49
## Fiat 500 49 53 32 11
## Audi A4 12 28 10 57
## Mini Cooper 6 57 8 24
## Mazda MX5 3 22 6 17
## Practical Family Oriented Versatile
## Volkswagen Golf 44 12 25
## Opel Corsa 43 8 6
## Nissan Qashgai 25 39 37
## Toyota Prius 16 39 21
## BMW X5 23 41 30
## Volvo V50 40 60 39
## Renault Espace 52 74 39
## Citroen C4 Picasso 47 72 31
## Ford Focus Cmax 49 56 31
## Mercedes C-class 15 16 13
## Fiat 500 39 3 5
## Audi A4 33 28 27
## Mini Cooper 26 1 8
## Mazda MX5 6 1 5
## Good price-quality ratio Luxurious Safe Sporty
## Volkswagen Golf 30 12 40 29
## Opel Corsa 43 1 19 8
## Nissan Qashgai 20 21 23 26
## Toyota Prius 21 11 19 8
## BMW X5 7 58 40 47
## Volvo V50 21 32 51 10
## Renault Espace 15 10 23 1
## Citroen C4 Picasso 29 5 17 1
## Ford Focus Cmax 25 7 25 8
## Mercedes C-class 6 67 45 30
## Fiat 500 20 6 5 8
## Audi A4 16 56 50 43
## Mini Cooper 5 30 16 51
## Mazda MX5 11 28 4 65
## Attractive Comfortable Powerful Status symbol
## Volkswagen Golf 33 27 20 23
## Opel Corsa 9 11 0 3
## Nissan Qashgai 24 34 28 11
## Toyota Prius 10 23 9 16
## BMW X5 36 46 57 51
## Volvo V50 17 45 24 14
## Renault Espace 12 47 9 6
## Citroen C4 Picasso 13 42 5 3
## Ford Focus Cmax 12 32 10 2
## Mercedes C-class 41 55 46 57
## Fiat 500 40 6 1 12
## Audi A4 49 53 47 43
## Mini Cooper 53 16 16 45
## Mazda MX5 39 12 37 39
## Technically advanced Sustainable Original Nice design
## Volkswagen Golf 10 43 5 20
## Opel Corsa 1 16 2 9
## Nissan Qashgai 13 17 11 13
## Toyota Prius 46 29 19 9
## BMW X5 32 19 8 31
## Volvo V50 13 43 3 12
## Renault Espace 6 18 7 17
## Citroen C4 Picasso 1 10 6 14
## Ford Focus Cmax 3 20 3 13
## Mercedes C-class 43 35 8 28
## Fiat 500 2 7 37 35
## Audi A4 35 39 7 42
## Mini Cooper 12 15 42 48
## Mazda MX5 17 8 22 40
## Value for the money High trade-in value Exclusive
## Volkswagen Golf 24 41 0
## Opel Corsa 29 2 4
## Nissan Qashgai 12 3 5
## Toyota Prius 10 4 8
## BMW X5 8 36 19
## Volvo V50 18 12 4
## Renault Espace 12 0 3
## Citroen C4 Picasso 15 1 0
## Ford Focus Cmax 15 2 1
## Mercedes C-class 7 48 14
## Fiat 500 7 3 14
## Audi A4 16 37 10
## Mini Cooper 5 16 29
## Mazda MX5 9 4 17
## Popular Outdoor Green City focus Workmanship
## Volkswagen Golf 55 6 6 30 14
## Opel Corsa 34 4 5 51 3
## Nissan Qashgai 15 43 2 8 10
## Toyota Prius 10 4 36 26 19
## BMW X5 13 46 2 1 28
## Volvo V50 9 14 5 4 17
## Renault Espace 27 20 2 5 4
## Citroen C4 Picasso 26 14 7 8 3
## Ford Focus Cmax 23 11 3 17 1
## Mercedes C-class 16 5 2 8 39
## Fiat 500 24 1 10 58 3
## Audi A4 26 7 5 10 26
## Mini Cooper 37 5 6 51 11
## Mazda MX5 5 13 0 9 13
t(car$freq1[c(14,11,7,5,1,4),])
## Mazda MX5 Fiat 500 Renault Espace BMW X5
## Economical 3 49 17 1
## Agile 22 53 9 15
## Environmentally friendly 6 32 7 2
## Reliable 17 11 17 38
## Practical 6 39 52 23
## Family Oriented 1 3 74 41
## Versatile 5 5 39 30
## Good price-quality ratio 11 20 15 7
## Luxurious 28 6 10 58
## Safe 4 5 23 40
## Sporty 65 8 1 47
## Attractive 39 40 12 36
## Comfortable 12 6 47 46
## Powerful 37 1 9 57
## Status symbol 39 12 6 51
## Technically advanced 17 2 6 32
## Sustainable 8 7 18 19
## Original 22 37 7 8
## Nice design 40 35 17 31
## Value for the money 9 7 12 8
## High trade-in value 4 3 0 36
## Exclusive 17 14 3 19
## Popular 5 24 27 13
## Outdoor 13 1 20 46
## Green 0 10 2 2
## City focus 9 58 5 1
## Workmanship 13 3 4 28
## Volkswagen Golf Toyota Prius
## Economical 29 42
## Agile 40 10
## Environmentally friendly 20 51
## Reliable 58 27
## Practical 44 16
## Family Oriented 12 39
## Versatile 25 21
## Good price-quality ratio 30 21
## Luxurious 12 11
## Safe 40 19
## Sporty 29 8
## Attractive 33 10
## Comfortable 27 23
## Powerful 20 9
## Status symbol 23 16
## Technically advanced 10 46
## Sustainable 43 29
## Original 5 19
## Nice design 20 9
## Value for the money 24 10
## High trade-in value 41 4
## Exclusive 0 8
## Popular 55 10
## Outdoor 6 4
## Green 6 36
## City focus 30 26
## Workmanship 14 19
# load packages
library(FactoMineR)
library(ggplot2)
##
## Attaching package: 'ggplot2'
## The following objects are masked from 'package:psych':
##
## %+%, alpha
# load data tea
data(tea)
# select these columns
newtea = tea[, c("Tea", "How", "how", "sugar", "where", "always")]
# take a peek
head(newtea)
## Tea How how sugar where always
## 1 black alone tea bag sugar chain store Not.always
## 2 black milk tea bag No.sugar chain store Not.always
## 3 Earl Grey alone tea bag No.sugar chain store Not.always
## 4 Earl Grey alone tea bag sugar chain store Not.always
## 5 Earl Grey alone tea bag No.sugar chain store always
## 6 Earl Grey alone tea bag No.sugar chain store Not.always
# number of categories per variable
cats = apply(newtea, 2, function(x) nlevels(as.factor(x)))
cats
## Tea How how sugar where always
## 3 4 3 2 3 2
# apply MCA
mca1 = MCA(newtea, graph = FALSE)
# list of results
mca1
## **Results of the Multiple Correspondence Analysis (MCA)**
## The analysis was performed on 300 individuals, described by 6 variables
## *The results are available in the following objects:
##
## name description
## 1 "$eig" "eigenvalues"
## 2 "$var" "results for the variables"
## 3 "$var$coord" "coord. of the categories"
## 4 "$var$cos2" "cos2 for the categories"
## 5 "$var$contrib" "contributions of the categories"
## 6 "$var$v.test" "v-test for the categories"
## 7 "$ind" "results for the individuals"
## 8 "$ind$coord" "coord. for the individuals"
## 9 "$ind$cos2" "cos2 for the individuals"
## 10 "$ind$contrib" "contributions of the individuals"
## 11 "$call" "intermediate results"
## 12 "$call$marge.col" "weights of columns"
## 13 "$call$marge.li" "weights of rows"
# table of eigenvalues
mca1$eig
## eigenvalue percentage of variance cumulative percentage of variance
## dim 1 0.27976178 15.259733 15.25973
## dim 2 0.25774772 14.058967 29.31870
## dim 3 0.22013794 12.007524 41.32622
## dim 4 0.18792961 10.250706 51.57693
## dim 5 0.16876495 9.205361 60.78229
## dim 6 0.16368666 8.928363 69.71065
## dim 7 0.15288834 8.339364 78.05002
## dim 8 0.13838682 7.548372 85.59839
## dim 9 0.11569167 6.310455 91.90885
## dim 10 0.08612637 4.697802 96.60665
## dim 11 0.06221147 3.393353 100.00000
# data frame with variable coordinates
mca1_vars_df = data.frame(mca1$var$coord, Variable = rep(names(cats), cats))
# data frame with observation coordinates
mca1_obs_df = data.frame(mca1$ind$coord)
# plot of variable categories
ggplot(data=mca1_vars_df,
aes(x = Dim.1, y = Dim.2, label = rownames(mca1_vars_df))) +
geom_hline(yintercept = 0, colour = "gray70") +
geom_vline(xintercept = 0, colour = "gray70") +
geom_text(aes(colour=Variable)) +
ggtitle("MCA plot of variables using R package FactoMineR")
References: An overview of the psych package - http://personality-project.org/r/overview.pdf The Personality Project’s Guide to R - http://personality-project.org/r/psych/ psych: Procedures for Psychological, Psychometric, and Personality Research - http://www2.uaem.mx/r-mirror/web/packages/psych/ http://www.gastonsanchez.com/visually-enforced/how-to/2012/10/13/MCA-in-R/