November 09, 2025

Introduction

This project explores how marketing spending across TV, radio, and newspaper channels predicts product sales.
Linear regression is used to measure and compare the influence of each medium on sales performance.

Data and Preparation

Summary statistics for the Advertising dataset:
       TV             Radio          Newspaper          Sales      
 Min.   :  0.70   Min.   : 0.000   Min.   :  0.30   Min.   : 1.60  
 1st Qu.: 74.38   1st Qu.: 9.975   1st Qu.: 12.75   1st Qu.:10.38  
 Median :149.75   Median :22.900   Median : 25.75   Median :12.90  
 Mean   :147.04   Mean   :23.264   Mean   : 30.55   Mean   :14.02  
 3rd Qu.:218.82   3rd Qu.:36.525   3rd Qu.: 45.10   3rd Qu.:17.40  
 Max.   :296.40   Max.   :49.600   Max.   :114.00   Max.   :27.00  
[1] 200   4

The dataset includes 200 records with advertising budgets (in thousands) for TV, Radio, and Newspaper, along with product Sales (in thousands of units).

Simple Linear Regression (Sales ~ TV)

Insight: Higher TV advertising budgets are strongly associated with increased sales. The fitted line captures the average upward trend between the two variables.

SLR Coefficients

Simple Linear Regression Coefficients
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.033 0.458 15.360 0
TV 0.048 0.003 17.668 0

Interpretation: Each additional $1,000 of TV budget is associated with an average increase of 0.048 thousand units (~48 units) in sales, on average.

Model Equation (with Estimated Coefficients)

\[\hat{\text{Sales}} = 7.03 + 0.048\,\text{TV}.\]

Interpretation: Each additional thousand dollars of TV budget is associated with roughly a $48,000 increase in sales revenue, on average.

Residuals Check (SLR)

Insight: Residuals are scattered evenly around zero, showing that the linear model fits reasonably well without major systematic bias.

Multiple Linear Regression (MLR)

AdjR2_SLR AdjR2_MLR 
    0.610     0.896 
Analysis of Variance Table

Model 1: Sales ~ TV
Model 2: Sales ~ TV + Radio + Newspaper
  Res.Df     RSS Df Sum of Sq      F    Pr(>F)    
1    198 2102.53                                  
2    196  556.83  2    1545.7 272.04 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Insight: Including Radio and Newspaper budgets improves the model’s adjusted R², meaning combined advertising channels explain more sales variation than TV alone.

Model Form (Conceptual)

\[\hat{\text{Sales}} = \beta_0 + \beta_1\,\text{TV} + \beta_2\,\text{Radio} + \beta_3\,\text{Newspaper}.\]

Each \(\beta_j\) is the partial effect of that medium holding others constant.

MLR Coefficients

Multiple Linear Regression Coefficients
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.939 0.312 9.422 0.00
TV 0.046 0.001 32.809 0.00
Radio 0.189 0.009 21.893 0.00
Newspaper -0.001 0.006 -0.177 0.86

Insight: Radio shows the strongest positive coefficient, followed by TV. Newspaper’s effect is negligible.

Model Equation (with Estimated Coefficients)

\[\hat{\text{Sales}} = 2.94 + 0.046\,\text{TV} + 0.189\,\text{Radio} - 0.001\,\text{Newspaper}.\]

Interpretation: Holding other budgets constant, Sales are predicted to increase by 0.046 thousand units for each additional thousand dollars in TV spending and 0.189 thousand units for Radio.

Interactive 3D: Sales by TV and Radio

Insight: Sales peak when both TV and Radio budgets are high, highlighting complementary effects across channels.

Reproducible Code (Excerpt)

# Model comparisons

slr = lm(Sales ~ TV, data = ads)
mlr = lm(Sales ~ TV + Radio + Newspaper, data = ads)
c(SLR_AdjR2 = summary(slr)$adj.r.squared,
MLR_AdjR2 = summary(mlr)$adj.r.squared)
SLR_AdjR2 MLR_AdjR2 
0.6099148 0.8956373 

Insight: The multiple regression model explains about 89.6% of the variation in sales, compared to 61.0% with the simple model. Adding Radio and Newspaper greatly improves predictive accuracy.

Key Takeaways

  • TV budget alone explains a large share of sales variation (Adj. \(R^2\) = 0.61).
  • Adding Radio and Newspaper improves fit (Adj \(R^2\) = 0.90).
  • Allocating across media improves prediction accuracy.
  • Workflow: R Markdown (ioslides) + ggplot2 + plotly → RPubs.

This analysis demonstrates how statistical modeling supports evidence-based marketing decisions.

Thank you for viewing.

Project created in R Markdown (ioslides) and published via RPubs.