This analysis explores customer shopping behavior, focusing on payment methods, shipping preferences, purchase patterns across seasons, and the influence of subscription status and promo codes. The dataset includes customer information such as purchase amounts, product categories, review ratings, and more.
The dataset aims to provide insights into customer preferences, purchasing behaviors, and factors influencing buying decisions, helping businesses optimize their strategies and improve customer engagement.
# Load required libraries
#Data Manipulation
suppressPackageStartupMessages(library(dplyr))
#creating Elegant and Informative plots
suppressPackageStartupMessages(library(ggplot2))
#fast and Efficient Data import
suppressPackageStartupMessages(library(readr))
# Load the data
customer_data = read.csv("D:/dataset/shopping_trends.csv")
The purpose of this analysis is to identify customer preferences regarding payment methods and shipping types. By understanding these preferences, the business can:
Optimize payment options for smoother transactions. Focus on the most popular shipping types to ensure timely deliveries. Ultimately, this analysis helps the business align its operations with customer needs, improving customer satisfaction and operational efficiency.
# Most preferred payment method
payment_method_count = customer_data %>%
group_by(`Payment.Method`) %>%
summarise(Count = n()) %>%
arrange(desc(Count))
# Most preferred shipping type
shipping_type_count = customer_data %>%
group_by(`Shipping.Type`) %>%
summarise(Count = n()) %>%
arrange(desc(Count))
ggplot(shipping_type_count, aes(x = reorder(`Shipping.Type`, Count),
y = Count, fill = `Shipping.Type`)) +
geom_bar(stat = "identity") +
coord_flip() +
labs(title = "Most Preferred Shipping Type",
x = "Shipping Type",
y = "Count") +
theme_minimal()
We explore purchase behavior during different seasons.
The purpose of this analysis is to understand how purchase behavior varies across seasons. By visualizing the purchase amounts using a box plot. This analysis helps the business adjust its marketing, sales, and inventory strategies to align with seasonal spending patterns, ultimately improving sales performance and customer satisfaction.
# Box plot for purchase behavior across different seasons
ggplot(customer_data, aes(x = `Season`,
y = `Purchase.Amount..USD.`, fill = `Season`)) +
geom_boxplot() +
labs(title = "Purchase Behavior Across Seasons",
x = "Season",
y = "Purchase Amount (USD)") +
theme_minimal()
The purpose of this analysis is to identify the most popular colors purchased by customers across different seasons. By analyzing the frequency of color preferences in each season, the business can gain valuable insights into customer tastes and trends.
# Color popularity by season
color_season_count = customer_data %>%
group_by(Season, Color) %>%
summarise(Count = n(), .groups = "drop")
top_colors = color_season_count %>%
group_by(Season) %>%
top_n(10, Count)
ggplot(top_colors, aes(x = Season, y = Count, fill = Color)) +
geom_bar(stat = "identity") +
labs(title = "Top 10 Color Popularity Across Seasons",
x = "Season",
y = "Count") +
theme_minimal()
We examine the relationship between subscription status and frequency of purchases.
The purpose of this analysis is to compare how the frequency of purchases differs based on the subscription status of customers. By examining this relationship, the business can gain insights into whether subscribers make purchases more frequently than non-subscribers.
# Box plot to compare frequency of purchases by subscription status
ggplot(customer_data, aes(x = `Subscription.Status`,
y = `Frequency.of.Purchases`)) +
geom_boxplot(fill = "lightblue", color = "red") +
labs(title = "Frequency of Purchases by Subscription Status",
x = "Subscription Status",
y = "Frequency of Purchases") +
theme_minimal()
We analyze how promo code usage affects purchase amount and frequency.
The purpose of these analyses is to explore the impact of promo codes on purchase amounts and frequency of purchases. By comparing the behavior of customers who use promo codes versus those who do not, the business can gain insights into how promo codes influence buying behavior.
# Box plot for purchase amount with and without promo codes
ggplot(customer_data, aes(x = factor(`Promo.Code.Used`),
y = `Purchase.Amount..USD.`,
fill = factor(`Promo.Code.Used`))) +
geom_boxplot() +
labs(title = "Purchase Amount with and without Promo Code",
x = "Promo Code Used",
y = "Purchase Amount (USD)") +
theme_minimal()
# Box plot for frequency of purchases with and without promo codes
ggplot(customer_data, aes(x = factor(`Promo.Code.Used`),
y = `Frequency.of.Purchases`,
fill = factor(`Promo.Code.Used`))) +
geom_boxplot() +
labs(title = "Frequency of Purchases with and without Promo Code",
x = "Promo Code Used",
y = "Frequency of Purchases") +
theme_minimal()
We explore how review ratings correlate with purchase amounts.
The purpose of this analysis is to investigate the relationship between review ratings and purchase amounts. The goal is to understand whether higher customer ratings are associated with higher or lower spending, which can offer valuable insights for marketing and customer engagement strategies.
# Scatter plot for review ratings vs purchase amount
suppressWarnings(
ggplot(customer_data, aes(x = `Review.Rating`, y = `Purchase.Amount..USD.`)) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm", color = "blue") +
labs(title = "Review Rating vs Purchase Amount",
x = "Review Rating",
y = "Purchase Amount (USD)") +
theme_minimal())
## `geom_smooth()` using formula = 'y ~ x'
The purpose of this analysis is to compare review ratings across different product categories. By examining how customers rate products in various categories, the business can identify patterns or trends in customer satisfaction based on the type of product.
# Review ratings by product category
ggplot(customer_data, aes(x = Category, y = `Review.Rating`, fill = Category)) +
geom_boxplot() +
labs(title = "Review Ratings by Product Category",
x = "Category",
y = "Review Rating") +
theme_minimal()
The purpose of this analysis is to compare review ratings based on the shipping type selected by customers. This helps understand how shipping methods influence customer satisfaction, as shipping experience is often a key factor in overall product satisfaction.
# Review ratings by shipping type
ggplot(customer_data, aes(x = `Shipping.Type`, y = `Review.Rating`,
fill = `Shipping.Type`)) +
geom_boxplot() +
labs(title = "Review Ratings by Shipping Type",
x = "Shipping Type",
y = "Review Rating") +
theme_minimal()
The findings from this analysis provide valuable insights for businesses looking to refine their customer engagement strategies. By understanding and acting upon customer preferences for payment methods, shipping options, product colors, sizes, and promotional offers, businesses can create more personalized and effective customer experiences. Additionally, leveraging seasonal trends and subscription services can help drive customer retention and increase purchasing frequency.
This analysis underscores the importance of using data to understand customer behavior, enabling businesses to make informed decisions that ultimately lead to higher sales, improved customer satisfaction, and a stronger competitive position in the market.