{"id":8220,"date":"2021-04-09T22:26:23","date_gmt":"2021-04-09T22:26:23","guid":{"rendered":"https:\/\/wealthrevelation.com\/data-science\/2021\/04\/09\/a-case-study-on-retail-sales-and-customer-segmentation\/"},"modified":"2021-04-09T22:26:23","modified_gmt":"2021-04-09T22:26:23","slug":"a-case-study-on-retail-sales-and-customer-segmentation","status":"publish","type":"post","link":"https:\/\/wealthrevelation.com\/data-science\/2021\/04\/09\/a-case-study-on-retail-sales-and-customer-segmentation\/","title":{"rendered":"A CASE STUDY ON RETAIL SALES AND CUSTOMER SEGMENTATION"},"content":{"rendered":"<div>\n<p><strong>Introduction<\/strong><\/p>\n<p>Data science presents great opportunities for individual businesses to increase their profits. Among them, customer data is becoming extremely appealing to companies. In particular, customer segmentation allows companies to target their customers in a more customized way.\u00a0<\/p>\n<p>This is an exploratory data visualization project that aims to unravel gain opportunities for a chain of supermarkets. The Company was losing revenue and in need of a strategic review. The dataset includes 1,000 observations.<\/p>\n<p><strong>Exploratory data visualization<\/strong><\/p>\n<p>The results from the customer segmentation analysis are displayed in a shiny app that the user can navigate. The analysis reveals some important insights that can inform the company\u2019s marketing strategy.<\/p>\n<p>Below is a graph that visualizes the current state of the Company\u2019s sales in its three locations.<\/p>\n<p><em>Figure 1: Total sales per city<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img data-srcset=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-363067-xoVL8hr7-300x130.png 300w, https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-363067-xoVL8hr7.png 433w\" loading=\"lazy\" width=\"433\" height=\"187\" alt=\"\" data-src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-363067-xoVL8hr7.png\" data-sizes=\"(max-width: 433px) 100vw, 433px\" class=\"wp-image-73227 lazyload\" src=\"image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"><img loading=\"lazy\" width=\"433\" height=\"187\" src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-363067-xoVL8hr7.png\" alt=\"\" class=\"wp-image-73227\"><\/figure>\n<p>The first tab, &#8220;Location&#8221;, is shown in Figure 1. As we can see, there are differences in sales between the three supermarkets. The branch located in Naypyitaw is the most successful. However, these differences are not big and suggest that location may not be one of the variables having an important impact on the Company\u00b4s performance.<\/p>\n<p><em>Figure 2: Average sales per weekday and hour<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img data-srcset=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-496966-M5f66vIM-300x79.png 300w, https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-496966-M5f66vIM-600x157.png 600w, https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-496966-M5f66vIM.png 644w\" loading=\"lazy\" width=\"644\" height=\"169\" alt=\"\" data-src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-496966-M5f66vIM.png\" data-sizes=\"(max-width: 644px) 100vw, 644px\" class=\"wp-image-73228 lazyload\" src=\"image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"><img loading=\"lazy\" width=\"644\" height=\"169\" src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-496966-M5f66vIM.png\" alt=\"\" class=\"wp-image-73228\"><\/figure>\n<p>Sales are distributed over weekdays and hours as expected. We can see there are more on Mondays and Fridays than on the other days of the week.. Time of day also follows a pattern, as sales are concentrated between 12:00am and 15:00pm.<\/p>\n<p><em>Figure 3: Total sales per type of product<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img data-srcset=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-252716-wliOPqUT-300x122.png 300w, https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-252716-wliOPqUT.png 458w\" loading=\"lazy\" width=\"458\" height=\"186\" alt=\"\" data-src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-252716-wliOPqUT.png\" data-sizes=\"(max-width: 458px) 100vw, 458px\" class=\"wp-image-73229 lazyload\" src=\"image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"><img loading=\"lazy\" width=\"458\" height=\"186\" src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-252716-wliOPqUT.png\" alt=\"\" class=\"wp-image-73229\"><\/figure>\n<p>The distribution of sales by type of product shows that there are not huge differences in total sales within them. However, there are minor ones. &#8220;Food and beverages,&#8221; in particular,\u00a0 stands as the biggest contributor to total sales, while &#8220;Health and beauty&#8221; is the least important one.<\/p>\n<p><em>Figure 4: Total sales per gender<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img data-srcset=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-727073-mKsULFEk-300x130.png 300w, https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-727073-mKsULFEk.png 390w\" loading=\"lazy\" width=\"390\" height=\"169\" alt=\"\" data-src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-727073-mKsULFEk.png\" data-sizes=\"(max-width: 390px) 100vw, 390px\" class=\"wp-image-73230 lazyload\" src=\"image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"><img loading=\"lazy\" width=\"390\" height=\"169\" src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-727073-mKsULFEk.png\" alt=\"\" class=\"wp-image-73230\"><\/figure>\n<p>Overall, women represent a slightly bigger proportion of total sales than men. We can try to discern if this is the case for every type of product or if there are differences between them.\u00a0<\/p>\n<p><em>Figure 5: Total sales per type of product and gender<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img data-srcset=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-766329-mlNZvZHQ-300x118.png 300w, https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-766329-mlNZvZHQ.png 496w\" loading=\"lazy\" width=\"496\" height=\"195\" alt=\"\" data-src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-766329-mlNZvZHQ.png\" data-sizes=\"(max-width: 496px) 100vw, 496px\" class=\"wp-image-73231 lazyload\" src=\"image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"><img loading=\"lazy\" width=\"496\" height=\"195\" src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-766329-mlNZvZHQ.png\" alt=\"\" class=\"wp-image-73231\"><\/figure>\n<p>As shown in Figure 5, women buy more than men across most product types. &#8220;Food and beverages&#8221; is a category in which women clearly spend more in comparison to men. Interestingly, the biggest gap in consumption happens in &#8220;Health and beauty&#8221;, where men account for\u00a0 the biggest part of total sales. Both genders are close to\u00a0 even for &#8220;Electronic accessories&#8221; sales. These results suggest that targeting men and women for different specific types of products could increase sales in particular categories.<\/p>\n<p><em>Figure 6: Correlation between total sales and customer rating<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img data-srcset=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-464565-b1Di0X0E-300x131.png 300w, https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-464565-b1Di0X0E.png 379w\" loading=\"lazy\" width=\"379\" height=\"166\" alt=\"\" data-src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-464565-b1Di0X0E.png\" data-sizes=\"(max-width: 379px) 100vw, 379px\" class=\"wp-image-73232 lazyload\" src=\"image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"><img loading=\"lazy\" width=\"379\" height=\"166\" src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-464565-b1Di0X0E.png\" alt=\"\" class=\"wp-image-73232\"><\/figure>\n<p>Customer rating is a measure of a customer\u00b4s satisfaction summarized in a single score. The Figure above shows a very weak correlation between sales and customer ratings. Targeting highly satisfied customers can boost sales outcomes. A way to do this is by improving the Company\u00b4s membership program, as we proceed to analyze below.<\/p>\n<p><em>Figure 7: Total sales by membership<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img data-srcset=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-970815-JYYUSFLj-300x130.png 300w, https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-970815-JYYUSFLj.png 391w\" loading=\"lazy\" width=\"391\" height=\"169\" alt=\"\" data-src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-970815-JYYUSFLj.png\" data-sizes=\"(max-width: 391px) 100vw, 391px\" class=\"wp-image-73233 lazyload\" src=\"image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"><img loading=\"lazy\" width=\"391\" height=\"169\" src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-970815-JYYUSFLj.png\" alt=\"\" class=\"wp-image-73233\"><\/figure>\n<p>As shown in Figure 7, the differences in sales between members and non-members is very small; members spend on average 327.79 while non-members spend 318.12 . We can take a deeper look to provide a more nuanced analysis.<\/p>\n<p><em>Figure 8: Membership by gender<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img data-srcset=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-577040-3LbnpiCV-300x118.png 300w, https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-577040-3LbnpiCV.png 408w\" loading=\"lazy\" width=\"408\" height=\"160\" alt=\"\" data-src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-577040-3LbnpiCV.png\" data-sizes=\"(max-width: 408px) 100vw, 408px\" class=\"wp-image-73234 lazyload\" src=\"image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"><img loading=\"lazy\" width=\"408\" height=\"160\" src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-577040-3LbnpiCV.png\" alt=\"\" class=\"wp-image-73234\"><\/figure>\n<p>As pointed out before, women represent a slightly higher amount of sales than men. Therefore, women could be a better target for the membership program, especially given their larger spend on\u00a0 the &#8220;Food and beverages&#8221; category. We already see a higher rate of participation among women in the membership program, 52%, that could be increased.<\/p>\n<p><em>Figure 9: Total sales per type of product and membership<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img data-srcset=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-165565-ehipR2EU-300x123.png 300w, https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-165565-ehipR2EU.png 423w\" loading=\"lazy\" width=\"423\" height=\"173\" alt=\"\" data-src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-165565-ehipR2EU.png\" data-sizes=\"(max-width: 423px) 100vw, 423px\" class=\"wp-image-73235 lazyload\" src=\"image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"><img loading=\"lazy\" width=\"423\" height=\"173\" src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-165565-ehipR2EU.png\" alt=\"\" class=\"wp-image-73235\"><\/figure>\n<p>In Figure 9, we break down total sales by type of product for members and non-members. Participants in the membership program spend more on products that are bought in a more recurrent way. The biggest positive difference is in &#8220;Food and beverages,&#8221; and the biggest negative difference is in &#8220;Electronic accessories.&#8221; Figure 7 showed only slightly higher total sales by members due to the negative correlation with total sales in &#8220;Electronic accessories,&#8221; which is probably not causal.<\/p>\n<p><em>Figure 10: Membership by customer rating<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img data-srcset=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-209405-aPkHlSSg-300x127.png 300w, https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-209405-aPkHlSSg.png 418w\" loading=\"lazy\" width=\"418\" height=\"177\" alt=\"\" data-src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-209405-aPkHlSSg.png\" data-sizes=\"(max-width: 418px) 100vw, 418px\" class=\"wp-image-73236 lazyload\" src=\"image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"><img loading=\"lazy\" width=\"418\" height=\"177\" src=\"https:\/\/nycdsa-blog-files.s3.us-east-2.amazonaws.com\/2021\/04\/guillermo-ruiz\/image-209405-aPkHlSSg.png\" alt=\"\" class=\"wp-image-73236\"><\/figure>\n<p>As we can see in Figure 10, customer satisfaction does not seem to affect participation. This should be also considered in the light of the weak correlation between customer rating and total sales shown in Figure 6, which together suggests there is a pool of satisfied customers that could be targeted.<\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p>We provide evidence to support possible strategic changes for a loss making supermarket. These changes imply targeting specific segments of customers (men and women, by type of product, satisfied customers, members of the loyalty program) in a customized way.<\/p>\n<p>The Shiny app discussed in this blog post together with the relevant code and data can be found\u00a0<a href=\"https:\/\/github.com\/GuilleRuizC\/Customer-Segmentation\">here<\/a>.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/nycdatascience.com\/blog\/student-works\/r-shiny\/a-case-study-on-retail-sales-and-customer-segmentation\/<\/p>\n","protected":false},"author":0,"featured_media":8221,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts\/8220"}],"collection":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/comments?post=8220"}],"version-history":[{"count":0,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts\/8220\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/media\/8221"}],"wp:attachment":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/media?parent=8220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/categories?post=8220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/tags?post=8220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}