The correlation coefficient measures the level of the association between two variables x and y. It’s also possible to compute the correlation coefficient between the two variables using the R function cor(): cor(marketing$sales, marketing$youtube) # 0.782
This is a good thing, because, one important assumption of the linear regression is that the relationship between the outcome and predictor variables is linear and additive. The graph above suggests a linearly increasing relationship between the sales and the youtube variables.
Ggplot(marketing, aes(x = youtube, y = sales)) +