How can we identify and capitalize on purchasing behavior fluctuations during seasonal trends and holiday to drive revenue growth?
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.
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.
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")
The report showcases monthly sales trends, illustrating peaks and lows on a month-to-month basis. In December, sales soar to their highest point, aligning perfectly with the holiday season. May witnesses another peak, corresponding with the onset of summer or warmer weather months. Conversely, September experiences the lowest sales, attributed to the absence of notable events during the month.
transactions$transaction_date <- as.Date(transactions$transaction_timestamp)
transactions$month <- month(transactions$transaction_date)
transactions$day <- day(transactions$transaction_date)
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 <- left_join(transactions, holidays, by = c("transaction_date" = "date"))
monthly_sales <- transactions %>%
group_by(month) %>%
summarise(total_sales = sum(sales_value, na.rm = TRUE))
par(mar = c(3, 4, 4, 3) + 0.1)
plot(monthly_sales$month,
monthly_sales$total_sales,
type = "o",
pch = 19,
col = "blue",
xlab = "Month",
ylab = "Total Sales",
main = "Monthly Sales Trends",
xlim = c(1, 12),
ylim = range(monthly_sales$total_sales, na.rm = TRUE),
xaxt = "n",
yaxt = "n",
bty = "l")
grid()
axis(1, at = 1:12, labels = month.abb)
axis(2, las = 1, cex.axis = 0.65)
legend("topright", legend = "Total Sales", col = "blue", pch = 19, bty = "n")
This graph depicts sales volume corresponding to notable holidays, revealing their impact on consumer buying tendencies. Independence Day emerges as the holiday with the highest sales, demonstrating significant consumer spending. Conversely, New Year’s Day registers the lowest sales, indicating comparatively lower consumer expenditure during this holiday period.
transactions <- left_join(transactions, holidays, by = c("transaction_date" = "date"))
transactions <- transactions %>%
select(-holiday.x) %>%
rename(holiday = holiday.y) %>%
left_join(holidays, by = c("transaction_date" = "date"))
transactions <- transactions %>%
select(-holiday.x) %>%
rename(holiday = holiday.y)
unique_transaction_dates <- unique(transactions$transaction_date)
unique_holiday_dates <- unique(holidays$date)
holidays$month_day <- format(holidays$date, "%m-%d")
transactions <- transactions %>%
mutate(month_day = format(transaction_date, "%m-%d"))
merged_data <- transactions %>%
left_join(holidays, by = "month_day")
holiday_sales <- merged_data %>%
filter(!is.na(holiday.y)) %>%
group_by(holiday.y) %>%
summarise(total_sales = sum(sales_value, na.rm = TRUE))
holiday_sales_plot <- ggplot(holiday_sales, aes(x = holiday.y, y = total_sales, fill = holiday.y)) +
geom_bar(stat = "identity") +
labs(title = "Holiday Sales Trends", x = "Holiday", y = "Total Sales") +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
print(holiday_sales_plot)
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)
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)
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.
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
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.