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.
library(readr)
ad_sales <- read_csv('https://raw.githubusercontent.com/utjimmyx/regression/master/advertising.csv')
## 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.
## • `` -> `...1`
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`.
Question 1 I think the relationship between X and Y would be the fact they are so close together on the scatter plot making it easier to pinpoint specific data.
Question 2 On a scatter plot, a coefficient usually refers to the correlation coefficient or the regression coefficient. Yes, there is a relation between TV advertising and sales. You can see that most of the advertisement is clustered within sales, meaning, when most TV ads go out to the public the feedback is pretty well recieved with the amount of sales they are getting.
Question 3 A simple regression analysis can answer a lot of questions starting with how customer behavior & sales prediction affects sales and how marketing performance & ROI has a relationship with media engagement.
Question 4 Yes, you can plot the relationship between radio advertisements and sales and compare it to how well TV advertisements sell. As you can see radio ads do not sell as much as TV ads because most people don’t listen to the radio because of some factors like playing their own music or listening to another form of Bluetooth media.