title: “Bivariate analysis -Logan Salcido” author: “Logan Salcido.
Follow me on BlueSky: https://bsky.app/profile/logansalcido.bsky.social date:
01/29/25 output: html_document editor_options:
chunk_output_type: console
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)
plot(sales ~ radio, data = ad_sales)
This is the end of part 1 for my exploratory analysis.
library(ggplot2)
head(ad_sales)
## # A tibble: 6 × 6
## ...1 X1 TV radio newspaper sales
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 1 1 230. 37.8 69.2 22.1
## 2 2 2 44.5 39.3 45.1 10.4
## 3 3 3 17.2 45.9 69.3 9.3
## 4 4 4 152. 41.3 58.5 18.5
## 5 5 5 181. 10.8 58.4 12.9
## 6 6 6 8.7 48.9 75 7.2
ggplot(data = ad_sales, aes(x = TV)) +
geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
This is the end of part 2 for my exploratory analysis.
plot(y3 ~ x2, data = anscombe, pch = 16)
abline(lm(y3 ~ x3, anscombe), col = "grey20")
Yes, the given data set analyzes TV and Sales data. The scatter plot suggests a positive linear relationship. This means as TV advertising increases, so does sales.
A coefficient in regression analysis tells us how much the dependent variable (in this case it is sales) changes when we increase the independent variable (Tv advertising) by one unit. It shows how TV advertising affects sales and how strong of an impact it is.
Some marketing questions we can address are as follows: 1. Does spending more on advertising increase sales? 2. Which advertising channel (TV, radio, newspaper) has the biggest impact on sales? 3. How much can we expect sales to increase per additional dollar spent on ads? 4. Is there a minimum level of advertising needed to see an affect on sales?
Some of the limitations are as follows: 1. You can only analyze one independent variable at a time, so it cannot account for multiple factors affecting sales. 2. It assumes a linear relationship, so if the relationship is not linear then the regression might not be as accurate. 3. A few extreme values can skew the regression line and cause misleading conclusions.
The scatter plot shows a positive relationship between radio and sales. Looking at the plot, we can conclude that radio advertising does have a positive effect on sales, but not as much as TV.
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