Using the Elbow and K-means functions with four variables
Now, we are going to add a fourth variable, the shipping cost, to the analysis. With this information, we will explore the influence of the logistics demanding infrastructure on the profits of the company. Remember that we pursue to get more revenue without investing more in fixed costs such as delivery operations. We will apply our knowledge of the Elbow and K-means functions to get the optimal number of groups, and then get the segmentation with K-means. See Figure 6.24 where the elbow function returns the number of groups. There is no chance to plot a chart of four variables, so we will have to trust in our expertise and judgment to interpret the groups that K-means will return.
In Figure 6.24, we can see that the optimal number of groups for the four variables (revenue, month, quantity, and shipping costs) is eight because this is when the curve...