Hypotheses

Loading Data

library(ggplot2)
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(readr)

# Creating the dataset
display_data <- data.frame(
  spend = c(22.61, 37.28, 55.57, 45.42, 50.22, 33.05, 12.88, 23.87, 58.38, 48.16, 63.18, 81.28, 28.33, 28.73, 64.82, 55.13, 81.05, 91.28, 65.31, 36.34, 25.02, 38.78, 31.52, 51.86, 33.61, 54.93, 39.68, 1.12, 23.04),
  revenue = c(58.88, 44.92, 141.56, 209.76, 197.68, 204.36, 117.32, 72.04, 290.4, 245.52, 264.6, 469.4, 66.72, 16.16, 357.76, 298.92, 265.72, 522, 311.52, 279.96, 185.36, 81.12, 311.92, 353.68, 168.44, 403.88, 289.28, 17.44, 235.16),
  display = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1)
)

# View first few rows
head(display_data)
##   spend revenue display
## 1 22.61   58.88       0
## 2 37.28   44.92       0
## 3 55.57  141.56       0
## 4 45.42  209.76       0
## 5 50.22  197.68       0
## 6 33.05  204.36       0

Simple Regression Model (Predicting Revenue Based on Spend)

# Running a simple linear regression model
simple_model <- lm(revenue ~ spend, data = display_data)
simple_summary <- summary(simple_model)
simple_summary
## 
## Call:
## lm(formula = revenue ~ spend, data = display_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -145.210  -54.647    1.117   67.780  149.476 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  10.9397    37.9668   0.288    0.775    
## spend         4.8066     0.7775   6.182 1.31e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 86.71 on 27 degrees of freedom
## Multiple R-squared:  0.586,  Adjusted R-squared:  0.5707 
## F-statistic: 38.22 on 1 and 27 DF,  p-value: 1.311e-06

Interpretation

  • Coefficient for Spend: 4.8066, meaning that for each additional unit spent, revenue increases by approximately 4.81 units.
  • Intercept: 10.9397, representing the estimated revenue when no spend occurs.
  • P-value for Spend (1.31e-06): Highly significant (p < 0.05), indicating a strong relationship between spend and revenue.
  • R-squared (0.586): 58.6% of the variation in revenue is explained by spend.
  • Managerial Recommendation: Since spend significantly impacts revenue, increasing ad spend can drive revenue growth, but further optimization and diminishing returns analysis should be considered.