library(devtools) 
## Loading required package: usethis
install_github("vqv/ggbiplot")
## Skipping install of 'ggbiplot' from a github remote, the SHA1 (f7ea76da) has not changed since last install.
##   Use `force = TRUE` to force installation
library(ggbiplot)
## Loading required package: ggplot2
## Loading required package: plyr
## Loading required package: scales
## Loading required package: grid
?ggbiplot  #see the official introduction to this library
data <- read.csv("Bakersfield_Grocery1.csv", header=TRUE, row.names=1)
site.groups <- c(rep("a", 3), rep("b", 3),
                 rep("c", 3))
data.pca <- prcomp(data[,-1], scale. = TRUE)
data.pca <- prcomp(data, scale. = TRUE)
ggbiplot(data.pca, labels =  rownames(data))

g1 <- ggbiplot(data.pca, obs.scale = 1, var.scale = 1, 
              groups = site.groups, 
              ellipse = TRUE, circle = TRUE, labels =  rownames(data))
g1 <- g1 + scale_color_discrete(name = '')
g1 <- g1 + theme(legend.direction = 'horizontal', 
               legend.position = 'top')
print(g1)

Data Analysis and Reporting - Understanding the perceptions of consumers who do not have a college degree

library(devtools) 
install_github("vqv/ggbiplot")
## Skipping install of 'ggbiplot' from a github remote, the SHA1 (f7ea76da) has not changed since last install.
##   Use `force = TRUE` to force installation
library(ggbiplot)
data <- read.csv("Bakersfield_Grocery2.csv", header=TRUE, row.names=1)
site.groups <- c(rep("a", 3), rep("b", 3),
                 rep("c", 3))
data.pca <- prcomp(data[,-1], scale. = TRUE)
data.pca <- prcomp(data, scale. = TRUE)
ggbiplot(data.pca, labels =  rownames(data))

g2 <- ggbiplot(data.pca, obs.scale = 1, var.scale = 1, 
              groups = site.groups, 
              ellipse = TRUE, circle = TRUE, labels =  rownames(data))
g2 <- g2 + scale_color_discrete(name = '')
g2 <- g2 + theme(legend.direction = 'horizontal', 
               legend.position = 'top')
print(g2)

Disclaimer

The sample size used for this survey exercise is small. That said, please do not try to generalize the results to the entire population. Please keep in mind that for generalization purposes, we would usually need a survey from at least 30 customers for most statistical analysis. ## References (methods): Nenadic, O., & Greenacre, M. (2007). Correspondence analysis in R, with two-and three-dimensional graphics: the ca package. Journal of statistical software, 20(3). https://goedoc.uni-goettingen.de/bitstream/handle/1/5892/Nenadic.pdf?sequence=1 Sensographics and Mapping Consumer Perceptions Using PCA and FactoMineR. https://www.r-bloggers.com/2017/09/sensographics-and-mapping-consumer-perceptions-using-pca-and-factominer/ The Unavoidable Instability of Brand Image. https://www.r-bloggers.com/2014/06/the-unavoidable-instability-of-brand-image/ The R Project for Statistical Computing. https://www.r-project.org/ R for Data Science - Hadley Wickham. https://r4ds.had.co.nz/ R Markdown. https://rmarkdown.rstudio.com/ R Markdown: The Definitive Guide - Bookdown. https://bookdown.org/yihui/rmarkdown/