This analysis uses the Warehouse and Retail Sales dataset, which tracks monthly retail sales, retail transfers, and warehouse sales for beverage alcohol products (wine, liquor, beer, kegs) sold through a distribution network.
library(readr)
library(dplyr)
library(ggplot2)
data <- read_csv("Warehouse_and_Retail_Sales.csv")
original_n <- nrow(data)
set.seed(123)
sample_data <- data %>% sample_frac(0.5)
sample_n <- nrow(sample_data)
original_n
## [1] 307645
sample_n
## [1] 153822
The original dataset contains 307,645 observations. For this
analysis, a random sample of approximately half the data was drawn
(using sample_frac(0.5) with a fixed seed for
reproducibility), resulting in 153,822 observations used in the
analysis.
summary(sample_data$`RETAIL SALES`)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NAs
## -6.490 0.000 0.320 7.051 3.250 2739.000 1
ggplot(sample_data, aes(x = `RETAIL SALES`)) +
geom_histogram(binwidth = 5, fill = "green") +
coord_cartesian(xlim = c(0, 100)) +
ggtitle("Distribution of Retail Sales (0-100 units)") +
xlab("Retail Sales") +
ylab("Count")
Retail sales are heavily right-skewed: the median case/unit sale is only 0.32, while a small number of products sell in much larger volumes (up to about 1,752 units), pulling the mean up to roughly 7.03. Most products move in small quantities, with a long tail of high-volume sellers.
sample_data <- sample_data %>%
mutate(DATE = as.Date(paste(YEAR, MONTH, "01", sep = "-")))
monthly_sales <- sample_data %>%
group_by(DATE) %>%
summarise(total_retail_sales = sum(`RETAIL SALES`, na.rm = TRUE))
ggplot(monthly_sales, aes(x = DATE, y = total_retail_sales)) +
geom_point() +
geom_smooth() +
ggtitle("Total Retail Sales as a Function of Date") +
xlab("Date") +
ylab("Total Retail Sales")
Total monthly retail sales fluctuate seasonally, with December standing out as a clear peak (holiday buying), and a notable spike in March 2020 that lines up with pandemic-related stockpiling before dropping off later that year.
Retail sales volume is dominated by a large number of low-volume product sales rather than a few bestsellers, which suggests marketing efforts might get more traction focusing on broad product mix and availability rather than pushing a handful of “hero” products. The monthly trend shows clear seasonality, with December sales spiking well above the rest of the year, pointing to a strong opportunity for holiday-timed promotions. The March 2020 spike also shows how external shocks can temporarily override normal seasonal patterns, which is worth factoring into any demand forecasting.