Sypnosis

Our assignment involves examining potential avenues for growth where Regork can invest, aiming to enhance both revenue and profits. Enterprises such as Regork are consistently seeking ways to make a significant impact and capture the trust and preference of consumers. Particularly for a grocery business dealing with many products, it is hard to find out what each consumer is interested in buying.

Given the large amount of products within the soap category, in bar and liquid forms, our objective is to investigate how the number of children in each household influences the purchasing preference between these two products. We aim to analyze the factors that contribute to consumer choices and understand the impact of household demographics, specifically the amount of children, on the selection between bar and liquid soap.

Packages Required

completejourney: Data set that uses transactions within a number of households within the year 2017

tidyverse: A number of packages that assists in data manipulation, visualization, and exploration

dplyr: Package that allows manipulation and transforming of the data

ggplot2: Data visualization package that plots graphs from given data

Data Preperation

The given data was used from the completejourney package in R. This data set comes with several different tables. The tables I used for my project were transactions_sample, demographics, products, and coupon_redemptions.

The first step I did was to view these four tables within R. I wanted to reference these four tables to use in my dataset.

completejourney::transactions_sample
## # A tibble: 75,000 × 11
##    household_id store_id basket_id   product_id quantity sales_value retail_disc
##    <chr>        <chr>    <chr>       <chr>         <dbl>       <dbl>       <dbl>
##  1 2261         309      31625220889 940996            1        3.86        0.43
##  2 2131         368      32053127496 873902            1        1.59        0.9 
##  3 511          316      32445856036 847901            1        1           0.69
##  4 400          388      31932241118 13094913          2       11.9         2.9 
##  5 918          340      32074655895 1085604           1        1.29        0   
##  6 718          324      32614612029 883203            1        2.5         0.49
##  7 868          323      32074722463 9884484           1        3.49        0   
##  8 1688         450      34850403304 1028715           1        2           1.79
##  9 467          31782    31280745102 896613            2        6.55        4.44
## 10 1947         32004    32744181707 978497            1        3.99        0   
## # ℹ 74,990 more rows
## # ℹ 4 more variables: coupon_disc <dbl>, coupon_match_disc <dbl>, week <int>,
## #   transaction_timestamp <dttm>
completejourney::demographics
## # A tibble: 801 × 8
##    household_id age   income    home_ownership marital_status household_size
##    <chr>        <ord> <ord>     <ord>          <ord>          <ord>         
##  1 1            65+   35-49K    Homeowner      Married        2             
##  2 1001         45-54 50-74K    Homeowner      Unmarried      1             
##  3 1003         35-44 25-34K    <NA>           Unmarried      1             
##  4 1004         25-34 15-24K    <NA>           Unmarried      1             
##  5 101          45-54 Under 15K Homeowner      Married        4             
##  6 1012         35-44 35-49K    <NA>           Married        5+            
##  7 1014         45-54 15-24K    <NA>           Married        4             
##  8 1015         45-54 50-74K    Homeowner      Unmarried      1             
##  9 1018         45-54 35-49K    Homeowner      Married        5+            
## 10 1020         45-54 25-34K    Homeowner      Married        2             
## # ℹ 791 more rows
## # ℹ 2 more variables: household_comp <ord>, kids_count <ord>
completejourney::products
## # A tibble: 92,331 × 7
##    product_id manufacturer_id department    brand  product_category product_type
##    <chr>      <chr>           <chr>         <fct>  <chr>            <chr>       
##  1 25671      2               GROCERY       Natio… FRZN ICE         ICE - CRUSH…
##  2 26081      2               MISCELLANEOUS Natio… <NA>             <NA>        
##  3 26093      69              PASTRY        Priva… BREAD            BREAD:ITALI…
##  4 26190      69              GROCERY       Priva… FRUIT - SHELF S… APPLE SAUCE 
##  5 26355      69              GROCERY       Priva… COOKIES/CONES    SPECIALTY C…
##  6 26426      69              GROCERY       Priva… SPICES & EXTRAC… SPICES & SE…
##  7 26540      69              GROCERY       Priva… COOKIES/CONES    TRAY PACK/C…
##  8 26601      69              DRUG GM       Priva… VITAMINS         VITAMIN - M…
##  9 26636      69              PASTRY        Priva… BREAKFAST SWEETS SW GDS: SW …
## 10 26691      16              GROCERY       Priva… PNT BTR/JELLY/J… HONEY       
## # ℹ 92,321 more rows
## # ℹ 1 more variable: package_size <chr>
completejourney::coupon_redemptions
## # A tibble: 2,102 × 4
##    household_id coupon_upc  campaign_id redemption_date
##    <chr>        <chr>       <chr>       <date>         
##  1 1029         51380041013 26          2017-01-01     
##  2 1029         51380041313 26          2017-01-01     
##  3 165          53377610033 26          2017-01-03     
##  4 712          51380041013 26          2017-01-07     
##  5 712          54300016033 26          2017-01-07     
##  6 2488         51200092776 26          2017-01-10     
##  7 2488         51410010050 26          2017-01-10     
##  8 1923         53000012033 26          2017-01-14     
##  9 1923         54300021057 26          2017-01-14     
## 10 1923         57047091041 26          2017-01-14     
## # ℹ 2,092 more rows

Exploratory Data Analysis

Bar Soap and Liquid Soap

As highlighted in the introduction, safety concerns associated with the misuse of products can have an impact on families, particularly those with infants. The average quantity of bar soaps purchased shows the potential influence of safety considerations on the selection of products that families are hesitant to purchase:

## Welcome to the completejourney package! Learn more about these data
## sets at http://bit.ly/completejourney.

In addition, given the data that bar soap is not preferred among families with children, they may purchase other alternative soap options, such as liquid soap.

Additionally, I looked into the frequency of coupon utilization of purchasing both bar soaps and liquid soaps. This is aimed to have a deeper understanding of how coupons can influence consumer purchasing decisions within these product categories.

Similarly, given the data highlighting the lower popularity of bar soap among families with children, specifically towards alternative soap options like liquid soap.

## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ lubridate 1.9.3     ✔ tibble    3.2.1
## ✔ purrr     1.0.2     ✔ tidyr     1.3.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

# Merge data
merged_data_liquid <- merge(merge(products, transactions_sample, by = "product_id"), demographics, by = "household_id")

# Filter data for LIQUID SOAP
liquid_soap_data <- merged_data_liquid[merged_data_liquid$product_type == "LIQUID SOAP", ]

# Merge with coupon_redemptions
merged_data_liquid <- merge(liquid_soap_data, coupon_redemptions, by = "household_id", all.x = TRUE)

# Calculate average quantity and average coupon redemption
average_data_liquid <- merged_data_liquid %>%
  group_by(kids_count) %>%
  summarise(
    avg_quantity = mean(quantity, na.rm = TRUE),
    avg_coupon_count = mean(!is.na(coupon_upc))
  ) %>%
  filter(!is.na(avg_coupon_count))

# Plotting bar chart
ggplot(average_data_liquid, aes(x = factor(kids_count), y = avg_coupon_count)) +
  geom_bar(stat = "identity", fill = "darkred") +
  labs(title = "Average Coupons Redeemed for Liquid Soap by Kid Count",
       x = "Number of Kids in Household",
       y = "Average Coupons Redeemed")

Summary

Problem Statement Addressed In this analysis:

We looked at a business problem for Regork: how the impact of household size, based off the number of kids, on the purchasing behavior of liquid soap and bar soap. This information is valuable as it helps Regork market to specific demographics, by optimizing product placements, and strategically endorsing more coupons to demographics who are interested in them.

How We Addressed this Problem To address this problem:

We utilized a dataset from the completejourney package in R, that uses information on products, transactions, demographics, and coupon redemptions. The primary methodology involved merging these datasets, filtering relevant data related to liquid and bar soaps, and calculating average quantities purchased and coupon redemptions across the household sizes provided within the kid count.

Interesting insights that Analysis Provided:

It was interesting to observe the distinctions in coupon redemptions between bar and liquid soaps to the average quantities of these products. For bar soap, the highest average purchases were observed in households with zero children, which also had the highest frequency in coupon redemptions. However, households with a size of 3 or more, which had the highest frequency of liquid soap purchases, demonstrated the lowest coupon redemption rates among the four categories.

Proposition to Regork CEO For the Regork CEO:

the proposed solution involves tailoring coupon promotions for bar soaps towards households without children. This is due to our analysis revealed a high frequency in both purchasing rate and coupon usage. This targeted approach helps improve customer engagement further, as well as boost sales.

Limitations of Analysis:

Although there is a “kids count” data for each household, it does not mention the age of the kids. There can be a big change in how households purchase each type of soap, due to the stage of life their child(s) are currently in. In addition, there are more products within the soap catagory than bar form and liquid form. Some examples of products that were listed in the completejourney data set are body wash, facial soaps-scrubs-masks, and baby soaps.