R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

Note: this analysis was performed using the open source software R and Rstudio.

Objective

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

Bivariate analysis is one of the simplest forms of statistical analysis. It is generally used to find out if there is a relationship between two sets of values (or two variables). That said, it usually involves the variables X and Y (statisticshowto.com).

Dataset - We will be using two online datasets available in R for this tutorial

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

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

Yes, there is a relationship. The scatterplot shows that as x goes up, y goes up as well. The trend looks like a positive straight-line relationship.

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

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

Yes, there is a relationship because the scatterplot shows that as Tv ads goes up, so does the Sales as well. The trend looks like a positive straight-line relationship.

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

Yes, you can plot radio ads against sales because the points show that higher radio ad spending also connects with higher sales. The relationship is still positive even though it looks a little weaker than the TV and sales one.

Question 4: Three things you learned from this tutorial

  1. Bivariate analysis focuses on the relationship between two variables.
  2. Graphs make it easy to see if the relationship is positive, negative, or not related at all.
  3. Advertising spending can impact sales.

References

Bivariate Analysis Definition & Example https://www.statisticshowto.com/bivariate-analysis/#:~:text=Bivariate%20analysis%20means%20the%20analysis,the%20variables%20X%20and%20Y.

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