Objective

The objective of this tutorial is to explain how bivariate analysis works. This analysis can be used by marketers to make decisions about pricing, advertising, and promotion strategies.

Bivariate analysis examines the relationship between two variables, usually referred to as X and Y.


Dataset

plot(y3 ~ x2, data = anscombe, pch = 16)
abline(lm(y3 ~ x2, anscombe), col = "grey20")


Question 1: Is there a relationship between x and y? If so, what does the relationship look like?

Based on the scatterplot, there is a relationship between x and y. The relationship appears to be positive and roughly linear, meaning that as x increases, y also increases. However, the data shows some variation, so the relationship is not perfectly consistent.


library(readr)

ad_sales <- read_csv('https://raw.githubusercontent.com/utjimmyx/regression/master/advertising.csv')
## `curl` package not installed, falling back to using `url()`
## New names:
## Rows: 200 Columns: 6
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (6): ...1, X1, TV, radio, newspaper, sales
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
plot(sales ~ TV, data = ad_sales)
abline(lm(sales ~ TV, data = ad_sales), col = "red")


Question 2: Is there a relationship between TV advertising and Sales? If so, what does the relationship look like?

Yes, there is a strong relationship between TV advertising and sales. The relationship is positive and mostly linear. As TV advertising increases, sales also increase. The points in the scatterplot follow an upward trend, showing that TV advertising is very effective in influencing sales.


Question 3: Can you plot the relationship between radio advertising and Sales? If so, what does the relationship look like?

plot(sales ~ radio, data = ad_sales)
abline(lm(sales ~ radio, data = ad_sales), col = "blue")

The relationship between radio advertising and sales is positive, but it is weaker than the relationship between TV advertising and sales. The points are more spread out, which means the relationship is less consistent. This shows that radio advertising has an effect, but it is not as strong as TV advertising.


Question 4: Three things you learned from this tutorial

  1. Bivariate analysis helps identify relationships between two variables and is useful for decision-making.
  2. Scatterplots are important for visualizing relationships and trends in data.
  3. Different advertising channels have different levels of impact on sales, with TV being stronger than radio in this dataset.

References

Bivariate Analysis Definition & Example
https://www.statisticshowto.com/bivariate-analysis/

https://www.sciencedirect.com/topics/mathematics/bivariate-data