Introduction

Potential profit increase

The primary challenge I aim to address is identifying strategic opportunities to boost revenue streams from customers who have children by potentially adjusting pricing strategies and allocating additional resources for advertising initiatives.

How I came to the solution

By separating customers with kids and customers without kids, I was able to find which products they spend the most on. From there I was able to find the income range of customers buying the product and form a strategy for increasing profits.

How this is useful

This report will provide statistical information which the finance and marketing team can use. By delving into customer spending behaviors and income demographics, it provides information necessary for informed decision-making. Specifically, it provides where to adjust pricing strategies and channel resources for advertising campaigns, thereby maximizing revenue potential from the target demographic of customers with children.

Exploratory Data Analysis

Packages Required

completejourney provides the data set

suppressMessages(library(dplyr))
suppressMessages(library(ggplot2))
suppressMessages(library(completejourney))
suppressMessages(library(tidyverse))

Data

# Load Data
transactions <- get_transactions()
products <- products
demographics <- demographics
# Join demographics with transactions
transactions_demographics <- inner_join(demographics, transactions, by = "household_id")

# Join with products and create a column which looks for kids
joined_df <- transactions_demographics %>%
  inner_join(products, by = 'product_id') %>%
  mutate(kids = ifelse(kids_count == 0, 'no kids', 'kids'))
joined_df %>%
  group_by(kids) %>%
  summarize(total_sales = sum(sales_value)) %>%
  ggplot(aes(x = "", y = total_sales, fill = kids, label = paste0(round((total_sales /   
                                                                           sum(total_sales)) * 100), "%"))) +
  geom_bar(stat = "identity", width = 1) +
  coord_polar("y", start = 0) +
  ggtitle("Proportion of Total Sales by Customers with and without Kids") +
  theme_void() +
  theme(legend.position = "bottom",
        plot.title = element_text(hjust = 0.5)) +  # Center the title
  labs(fill = "") +
  geom_text(position = position_stack(vjust = 0.5))

Proportion of sales

Customers with kids contribute to 38% of total sales. This pie chart visually emphasizes the significance of customers with children in driving sales.

suppressWarnings(joined_df %>%
                   filter(kids == 'kids') %>%
                   group_by(department) %>%
                   summarize(total_sales = sum(sales_value)) %>%
                   ggplot(aes(x = department, y = total_sales)) +
                   geom_bar(stat = "identity") +
                   ggtitle("Total Sales by Department for Customers with Kids") +
                   theme_minimal() +
                   theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
                   xlab("Department") +
                   ylab("Total Sales") +
                   guides(fill = FALSE)
)

High Sales in Grocery

This graph illustrates the departments customers with children are shopping from. As you can see, the gorcery and drug gm departments have the majority of total sales. Grocery alone is accountable for 500k + in total sales

# filtered out gasoline
joined_df %>%
  filter(kids == 'kids') %>%
  filter(product_type != 'GASOLINE-REG UNLEADED') %>%
  group_by(product_category) %>%
  summarize(total_sales = sum(sales_value)) %>%
  filter(total_sales > 10000) %>%
  ggplot(aes(x = product_category, y = total_sales)) +
  geom_bar(stat = "identity") +
  ggtitle("Total Sales by Product Category for Customers with Kids") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
  xlab("Product Category") +
  ylab("Total Sales") +
  guides(fill = FALSE)

Which category of products are they buying

This graph illustrates sales value by product category for customers with kids. Gasoline is filtered out of the data since it severely skew the data. As you can see, soft drinks, beef, and other various dairy products are in the top items for customers. Soft drinks are a high margin item unlike beef. So lets continue the analysis looking at which soft drinks customers are buying.

# top 3 soft drinks families with kids are buying
joined_df %>%
  filter(kids == 'kids') %>%
  filter(product_category == 'SOFT DRINKS') %>%
  group_by(product_type) %>%
  summarize(total_sales = sum(sales_value)) %>%
  top_n(3, total_sales) %>%
  ggplot(aes(x = product_type, y = total_sales)) +
  geom_bar(stat = "identity") +
  ggtitle("Top 3 Soft Drink Products for Customers with Kids") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
  xlab("Products") +
  ylab("Total Sales") +
  guides(fill = FALSE)

Which products are customers buying

The most popular soft drink product among customers with kids is the 12/18 & 15 pack of cans, highlighting a specific consumer preference within this category.

suppressMessages(joined_df %>%
                   filter(kids == 'kids') %>%
                   filter(product_category == 'SOFT DRINKS') %>%
                   group_by(income, age) %>%
                   summarize(total_sales = sum(sales_value)) %>%
                   ggplot(aes(x = income, y = total_sales)) +
                   facet_wrap( ~ age) +
                   geom_bar(stat = "identity") +
                   ggtitle("Total Sales of Soft Drinks by Income Bracket and Age Group") +
                   theme_minimal() +
                   theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
                   xlab("Income Bracket") +
                   ylab("Total Sales") +
                   guides(fill = FALSE)
)

Income bracket and age range

As shown, most customers with kids are withing 35-54 with an income of under 100k.

suppressMessages(joined_df %>%
                   filter(kids == 'kids') %>%
                   filter(product_category == 'SOFT DRINKS') %>%
                   mutate(month = as.Date(format(transaction_timestamp, "%Y-%m-%01"))) %>%
                   group_by(kids, month, .drop = FALSE) %>%
                   summarize(total_sales = sum(sales_value)) %>%
                   ggplot(aes(x = month, y = total_sales)) +  # Changed 'date' to 'month'
                   geom_line() +
                   ggtitle("Total Sales of Soft Drinks Over Time") +
                   theme_minimal() +
                   xlab("Month") +  # Changed 'Date' to 'Month'
                   ylab("Total Sales")
)

Seasonality of Soft Drinks

Finally, the seasonality of when people are buying is important to take note. Soft drinks are mostly bought during the summer months of May, July, and August.

Summary

In the beginning of the analysis, I wanted to see what customers with children were purchasing to find where funds should be spent to increase revenue.

How I answered the business problem

The business problem of identifying strategic opportunities to boost revenue from customers with children was addressed through a comprehensive analysis of sales data and demographic information. By segmenting customers based on the presence of children and analyzing their spending behaviors, income demographics, and product preferences, actionable insights were derived to inform decision-making processes.

My recommendation

Based on the analysis, it is recommended to implement targeted pricing strategies and allocate additional resources towards advertising initiatives for soft drinks aimed at customers with children in the middle class during the summer months May, July, and August. Leveraging insights into their spending patterns and preferences, tailored marketing campaigns can be devised to maximize engagement and drive sales. Additionally, increasing the variety of soft drinks which fall into the 12/18 & 15 pack of cans can further drive interest and revenue in this area.

Limitations of the Analysis

While the analysis provides valuable insights into customer behaviors and preferences, it is important to acknowledge certain limitations. These include multiple assumptions made during the analysis such as the demand for the product is seasonal, soft drinks are a high margin item, and the quality of the data. Also, it is important to note that the data is from the year 2017, so the analysis may be outdated.