Exploring the data
First let us get an understanding of how the data behave when we try to find potential clusters. This section starts with intuitive exploring concerting attributes and later I will try to find the optimal number of clusters and model. Here I use K-means method with Manhattan metric. I have scaled the data in order to have the same scale on all attributes.
attribute_value_org <- as.matrix(data[,3:7])
attribute_value <- scale(attribute_value_org)
km1<-eclust(attribute_value, "kmeans", hc_metric="manhattan", k=2)
km2<-eclust(attribute_value, "kmeans", hc_metric="manhattan", k=4)
km3<-eclust(attribute_value, "kmeans", hc_metric="manhattan", k=5)
sil<-silhouette(km3$cluster, dist(attribute_value))
plot1 <- fviz_cluster(km1, main="K-means k=2", ggtheme=theme_classic(), palette = pal1)
plot2 <- fviz_cluster(km2, main="K-means k=4", ggtheme=theme_classic(), palette = pal1)
plot3 <- fviz_cluster(km3, main="K-means k=5", ggtheme=theme_classic(), palette = pal1)
plot6 <- fviz_silhouette(sil, ggtheme=theme_classic(), main="K-means k=5", , palette = pal1)
grid.arrange(plot1, plot2, ncol=2)

grid.arrange(plot3, plot6, ncol=2)

First plot shows that k-means with two clusters result in two groups of better-ranked brands and lower-ranked. Silhouettes are negative for more than 10 observations.
Taking 4 clusters makes all silhouettes positive. First 10 best brands are mostly in two clusters (olive green and yellow), which may exhibit that different attributes (marketing strategies) influence their fame. In PCA we will discuss that this is true.
At first glance there might be some outliers (ex. obs. 94). However, behavior of this brand can be explained as other marketing strategie plays role here and should not be omitted in interpretation of groups. Brands ranked 7 and 94 (olive green) have the biggest Instagram engagement rate. Despite them being so distant from each other in the ranking, it seems that they follow the same marketing strategy of engaging in conversation with customers. Most of brands ranked lower than 25 are in one cluster.
To gather more knowledge about data I need to check for the best model describing it.
K-means and PAM
After initial exploration and preparing the data I am going to use unsupervised learning methods and focus on proper implementation of the tools. First let us look at two methods of K-means and Partitioning Around Medoids. Those are used for grouping the observations based on similar characteristics, one centers around means and the other around medoids. To use those clustering tools first we need to see if observations are clusterable and what number of groups should we assume.
Statistic test shows that data are clusterable.
hops <- get_clust_tendency(attribute_value, 20, graph=TRUE, gradient=list(low="blue", mid="white", high="black"))
## Hopkins' statistic (interpretation for get_clust_tendency): 0.836976 data can be clustered
Next I will try to find an optimal number of clusters. The highest shilhouette in k-means and PAM is for 3 clusters and automatic tools also suggest 3. However, as said before, to have all shilhouettes positive I need to take 4 clusters. If we look at clusGap the gap statistic starts to stabilize around 5 clusters. Shilhouette for 4 clusters is higher than for 5 clusters in K-means. It is different when comparing Calinski-Harabasz index. The preference between 4 and 5 also changes in PAM (see figures below). That’s why I’m deciding to examine 5 clusters.
ch1 <- round(calinhara(attribute_value, km2$cluster),digits=2)
ch2 <- round(calinhara(attribute_value, km3$cluster),digits=2)
## Calinski-Harabasz index for k-means with k=4: 47.24
## Calinski-Harabasz index for k-means with k=5: 51.63
pamk.best<-pamk(attribute_value, krange=2:10,criterion="asw", usepam=TRUE, scaling=FALSE, alpha=0.01, diss=inherits(attribute_value, "dist"), critout=FALSE) # fpc::pamk()
## Number of clusters estimated by optimum average silhouette width: 3
plot1 <- fviz_nbclust(attribute_value, FUNcluster=kmeans, linecolor = pal1[1])
plot2 <- fviz_nbclust(attribute_value, FUNcluster=cluster::pam, linecolor = pal1[2])
grid.arrange(plot1, plot2, ncol=2, top="K-means / PAM")

plot1 <- fviz_nbclust(attribute_value, FUNcluster=kmeans, method="gap_stat", linecolor = pal1[3])+ theme_classic()
plot2 <- fviz_nbclust(attribute_value, FUNcluster=cluster::pam, method="gap_stat", linecolor = pal1[4])+ theme_classic()
grid.arrange(plot1, plot2, ncol=2, top="K-means / PAM")

pam2<-eclust(attribute_value, "pam", hc_metric="manhattan", k=5)
par(mfrow=c(1,2))
fviz_cluster(km3, main="K-means k=5", ggtheme=theme_classic(), palette = pal1)

fviz_cluster(pam2, main="PAM k=5", ggtheme=theme_classic(), palette = pal1)

If we look closely, only observation nr 17 changes its cluster while we change the method. According to this, I conclude that both methods give almost identical results and grouping has been done correctly. For the next section I will use the results from k-means for k=5.
xxc<-as.data.frame(cbind(attribute_value, km3$cluster))
colnames(xxc)[6]<-"clust"
par(mfrow=c(2,3))
boxplot(xxc[,1]~xxc[,6], vertical=TRUE, col=pal1[2], xlab='clusters', ylab=colnames(xxc)[1])
boxplot(xxc[,2]~xxc[,6], vertical=TRUE, col=pal2[2], xlab='clusters', ylab=colnames(xxc)[2])
boxplot(xxc[,3]~xxc[,6], vertical=TRUE, col=pal1[3], xlab='clusters', ylab=colnames(xxc)[3])
boxplot(xxc[,4]~xxc[,6], vertical=TRUE, col=pal2[5], xlab='clusters', ylab=colnames(xxc)[4])
boxplot(xxc[,5]~xxc[,6], vertical=TRUE, col=pal2[1], xlab='clusters', ylab=colnames(xxc)[5])

Boxplots for each variable in five clusters show that values differ in clusters, which proves that there is a proper grouping. Variables which are correlated display similarity in plots (I will discuss this correlation in next section).
First cluster has the biggest instagram following and hashtags number. Their marketing strategy is focused on instagram promotion. For example Anastasia Beverlly Hills or Huda Beauty was hugely promoted by beauty gurus on instagram and youtube hence massive amount of hashtags compared to other brands. Those make up artists are either famous and are paid to promote the brand or are trying to raise in fame so are using popular products promoted by the best in the industry.
Second cluster is the one where engagement and yearly change in searches is high. They market their product by engaging in conversation with customers, checking what they would like to see, promoting care for people (maybe planet). They are a talk of the community thats why an increase in searches. For example Florence by Mills is owned by Millie Bobby Brown who is a teen series star and promotes her beauty line on live talks on Instagram. That is still online marketing, but more personal than edited picture posted with hashtags. The marketing startegy as well as products are more natural than in the previous brand.
Forth has the biggest annual searches. Those are the brands with traditional marketing that customers have to search name on Google to buy from and not enter the site by hyperlink in Instagram bio. This brand might have evaluated that their customers are older or more traditional. Their cosmetics might be more of basic skincare products than colorful eye-shadow palettes. Then marketing is more focused on promoting the good name of the company and product quality in everyday situations. It may be on tv commercial, newspaper, poster. Then the customer remembers the company name and searches for it on the internet when in need of skincare/makeup products.
Third cluster has almost all variables at low values. Those are mostly the brands under 25th position whose marketing strategies are not well established. The analysis has shown no call for clustering this part more as well as PCA has shown no distinct direction for those variables.
Fifth cluster has better online following than third cluster, however it still achieves lower statistics than others. The positions in this cluster are higher than in third cluster.
In conclusion, this analysis shows that brands that put a lot of work into one chosen marketing strategy seem to be better in the ranking. The marketing team should evaluate what the brand’s customers are like, what will catch their interest and on what platforms it is best to find them. Then the team should plan their marketing according to that.