Introduction

Business Question

How can we identify and capitalize on purchasing behavior fluctuations during seasonal trends and holiday to drive revenue growth?

How we got to our solution

We got to our solution by identifying which seasonal trends and holidays have the biggest impact on purchasing behavior. We also discovered the primary factors that drive fluctuations in purchasing behaviors during these seasonal trends and holidays. Lastly, we figured out which marketing strategies can be used to maximize revenue growth.

Why this analysis is useful?

This analysis is useful because it helps us identify trends and patterns around the seasons which can be used to make strategic decisions. With strategic decisions, this could bring us to a competitive advantage against our competitors by understanding the market and customer behaviors better than competitors.

Packages Required

The completejourney provides access to data sets characterizing household level transactions over one year from a group of 2,469 households who are frequent shoppers at a grocery store. The other packages are packages and features we used to effectively create our data analysis.

library(completejourney)
library(dplyr)
library(lubridate)
library(RColorBrewer)
library(forecast)
library(ggplot2)
transactions <- get_transactions()
data("campaigns")
data("coupon_redemptions")
data("demographics")

Exploratory Data Analysis

Monthly Coupon Discounts

In the realm of retail, customer satisfaction is the peak, and our data reveals that the most opportune time for our customers to maximize their savings is during the month of May. This aligns with our historical sales data, indicating that May consistently ranks among our peak sales months. It’s during this period that our coupons offer the most significant returns to our valued customers, further enhancing their shopping experience with us.

transactions$transaction_timestamp<-as.Date(transactions$transaction_timestamp)
transactions$month <- month(transactions$transaction_timestamp)
monthly_coupon_disc <- transactions %>%
  group_by(month) %>%
  summarise(total_coupon_disc = sum(coupon_disc))
ggplot(monthly_coupon_disc, aes(x = month, y = total_coupon_disc)) +
  geom_line() +
  geom_point() +
  labs(title = "Distribution of Coupon Disc by Month", x = "Month", y = "Total Coupon Disc") +
  theme_minimal() +
  scale_x_continuous(breaks = 1:12, labels = month.name)

Monthly Retail Discounts

In the retail sector, understanding customer behavior is crucial, especially when it comes to their engagement with discounts. Our analysis reveals that monthly retail discounts have a significant impact on customer spending. For instance, during peak shopping months like May & December, our retail discounts are particularly attractive to customers, leading to increased sales.

transactions$month <- month(transactions$transaction_timestamp)
monthly_retail_disc <- transactions %>%
  group_by(month) %>%
  summarise(total_retail_disc = sum(retail_disc))
ggplot(monthly_retail_disc, aes(x = month, y = total_retail_disc)) +
  geom_col(fill = "blue", alpha = 0.7) +
  labs(title = "Distribution of Retail Disc by Month", x = "Month", y = "Total Retail Disc") +
  theme_minimal() +
  scale_x_continuous(breaks = 1:12, labels = month.name)

Forecasted Sales for Upcoming Holidays

This time series plot presents a forecast of projected sales for the upcoming year, offering a month-to-month analysis. The forecast model anticipates a consistent rise in sales from February to June, followed by a gradual decline leading up to the holiday season. Additionally, the forecast underscores the significant uptick in consumer spending during months with holidays, highlighting a robust correlation between holiday periods and increased sales.

holidays <- data.frame(
  holiday = c("New Year's Day", "Valentine's Day", "Easter", "Memorial Day", "Independence Day", "Labor Day", "Thanksgiving", "Christmas"),
  date = as.Date(c("2023-01-01", "2023-02-14", "2023-04-16", "2023-05-29", "2023-07-04", "2023-09-04", "2023-11-23", "2023-12-25"))
)
transactions$transaction_date <- as.Date(transactions$transaction_timestamp)
monthly_sales <- transactions %>%
  mutate(month = month(transaction_date, label = TRUE)) %>%
  group_by(month) %>%
  summarise(total_sales = sum(sales_value))
historical_sales_plot <- ggplot(monthly_sales, aes(x = month, y = total_sales)) +
  geom_line() +
  labs(title = "Historical Monthly Sales Trends", x = "Month", y = "Total Sales") +
  scale_x_discrete(labels = month.abb) + 
   theme_minimal()
holiday_sales <- transactions %>%
  mutate(is_holiday = ifelse(transaction_date %in% holidays$date, 1, 0)) %>%
  group_by(transaction_date) %>%
  summarise(total_sales = sum(sales_value), is_holiday = max(is_holiday)) %>%
  ungroup()
holiday_sales_ts <- ts(holiday_sales$total_sales, frequency = 12)
holiday_sales_forecast <- forecast::auto.arima(holiday_sales_ts)
future_dates <- as.Date(seq(max(holiday_sales$transaction_date) + 1, length.out = 12, by = "month"))
forecast_data <- data.frame(transaction_date = future_dates, 
                            total_sales = forecast(holiday_sales_forecast, h = 12)$mean)
forecast_data$transaction_date <- as.Date(as.character(forecast_data$transaction_date))
forecast_sales_plot <- ggplot(forecast_data, aes(x = transaction_date, y = total_sales)) +
  geom_line() +
  labs(title = "Forecasted Sales for Upcoming Holiday Seasons", x = "Month", y = "Total Sales") +
  scale_x_date(date_breaks = "1 month", date_labels = "%b") + 
  theme_minimal()
forecast_sales_plot
## Don't know how to automatically pick scale for object of type <ts>. Defaulting
## to continuous.

Historical Monthly

This graph aligns with our forecasted sales for upcoming holidays, utilizing historical monthly sales data to project sales for the forthcoming year. It echoes the trends observed in our previous graphs, affirming the significant influence of the holiday season on consumer spending patterns, consistently driving sales upward.ales

holidays <- data.frame(
  holiday = c("New Year's Day", "Valentine's Day", "Easter", "Memorial Day", "Independence Day", "Labor Day", "Thanksgiving", "Christmas"),
  date = as.Date(c("2023-01-01", "2023-02-14", "2023-04-16", "2023-05-29", "2023-07-04", "2023-09-04", "2023-11-23", "2023-12-25"))
)

transactions$transaction_date <- as.Date(transactions$transaction_timestamp)

monthly_sales <- transactions %>%
  mutate(month = month(transaction_date, label = TRUE)) %>%
  group_by(month) %>%
  summarise(total_sales = sum(sales_value) / 10)
historical_sales_plot <- ggplot(monthly_sales, aes(x = month, y = total_sales)) +
  geom_bar(stat = "identity", fill = "skyblue") +  
  labs(title = "Historical Monthly Sales Trends", x = "Month", y = "Total Sales") +
  scale_x_discrete(labels = month.abb) + 
  theme_minimal()
historical_sales_plot

Summary

The report stresses the importance of understanding and using consumer shopping trends during seasons and holidays to boost sales effectively. It shows how recognizing these patterns can help businesses make more money and stay competitive. For instance, sales are high in December and May due to holidays and the start of summer, but they dip in February and September. Coupon distribution follows a similar pattern, peaking in May and November but dropping in December and February. Looking ahead, sales are expected to rise steadily after February, then drop slightly before holidays. To make the most of these insights, businesses are advised to ramp up marketing during busy months, give out coupons strategically, adjust production to match sales, engage customers with targeted promotions, and keep an eye on sales and customer behavior for long-term growth.