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?

Your answer here

There is a linear relationship between x and y. The scatterplot shows a positive trend, meaning that as x increases, y also increases. The relationship appears approximately linear.

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?

Your answer here

There is a strong positive linear relationship between TV advertising and Sales. As TV advertising spending increases, sales tend to increase. The scatterplot shows a clear upward trend, indicating that TV advertising is a strong predictor of Sales.

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

###Your answer here There is a positive relationship between radio advertising and Sales. As radio advertising spending increases, sales also increase. However, the relationship appears weaker compared to TV advertising, as the data points are more dispersed. ###Question 4:Three things you learned from this tutorial ###Your answer here Bivariate analysis helps determine whether two variables are related. Scatterplots are useful tools to visually examine relationships between variables. Linear regression can quantify the strength and direction of relationships between variables.

Avocado Dataset Analysis

Research Question:

Does the average price of avocados affect the total volume sold? There appears to be a negative relationship between average price and total volume sold. As prices increase, the total volume sold tends to decrease. This suggests that consumers may be price sensitive. This analysis can help grocery store managers determine optimal pricing strategies. If demand is price sensitive, lowering prices slightly could increase total sales volume and revenue. library(readr) avocado <- read_csv(“avocado.csv”)

plot(Total.Volume ~ AveragePrice, data = avocado)

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