![]() Its value ranges between -1 (perfect negative correlation: when x increases, y decreases) and +1 (perfect positive correlation: when x increases, y increases).Ī value closer to 0 suggests a weak relationship between the variables. 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)) +
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |