Research Question

Does gender significantly affect the click-through rate (CTR) in the digital marketing campaign for convex lenses?

Hypotheses

  1. Null Hypothesis (H₀): Gender does not significantly affect the click-through rate.
  2. Alternative Hypothesis (H₁): Gender significantly affects the click-through rate.
library(readxl)
data <- read_excel("DMdata-1.xlsx")
head(data)
## # A tibble: 6 × 13
##   Gender Age   Race  Job   Website_type Background_color Income Digital_literacy
##   <chr>  <chr> <chr> <chr> <chr>        <chr>             <dbl>            <dbl>
## 1 Female 40~49 White Mana… Desktop      Light             50000                7
## 2 Female 18~29 White Engi… Desktop      Light             50000                4
## 3 Female 18~29 White Engi… Desktop      Light             50000                5
## 4 Female 50~59 White Mana… Desktop      Light             50000                5
## 5 Female 18~29 White Mana… Desktop      Light             50000                6
## 6 Female 30~39 Afri… Sales Desktop      Light             50000                4
## # ℹ 5 more variables: Click_through_rate <dbl>, Open_rates <dbl>,
## #   Typical_open_time <dbl>, Frequency_of_views <dbl>, Buy_rate <dbl>
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.3.2
data$Gender <- as.factor(data$Gender)

gender_ctr <- data %>%
  group_by(Gender) %>%
  summarize(Mean_CTR = mean(Click_through_rate, na.rm = TRUE))

print(gender_ctr)
## # A tibble: 2 × 2
##   Gender Mean_CTR
##   <fct>     <dbl>
## 1 Female     19.2
## 2 Male       18.4
ggplot(gender_ctr, aes(x = Gender, y = Mean_CTR, fill = Gender)) +
  geom_bar(stat = "identity") +
  labs(title = "Click-Through Rate by Gender", x = "Gender", y = "Mean Click-Through Rate")

t_test <- t.test(Click_through_rate ~ Gender, data = data)
print(t_test)
## 
##  Welch Two Sample t-test
## 
## data:  Click_through_rate by Gender
## t = 2.2528, df = 448.35, p-value = 0.02475
## alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
## 95 percent confidence interval:
##  0.09685613 1.42079404
## sample estimates:
## mean in group Female   mean in group Male 
##             19.19163             18.43281

Interpretation of Results

Based on the above analysis: 1. The bar plot indicates the average click-through rates for each gender. 2. The t-test results will help determine if the observed difference in CTR between genders is statistically significant.