Module# 8: Correlation or regression analysis using ggplot2

I learn some new stuff while doing this assignment. I knew how are "casual" linear regression lines are added to scatter plots (that can be achieved with the geom_point & geom_smooth). But I have never done a graph where regression is mixed with the correletation. I would stay away from these type of graphs, because for normal audience it is highly unitutive and it looks to crowded. Anways, the assignemnt asked to:

"Create [a] visual analytics based on correlation or regression analysis using ggplot2. The visual will follow textbook recommendation to use grid to enhance the comparisons between scatter plots or your variables."

So here is the code chunk:


And the image which is generated from above code is this (Refrence):
{Please click on the graph to open, or right-click to open on the new window}


Neat way to see the correlation and linear regression of each mtcars data with each other. For example we can example that horsepower (hp) and weight (wt) is negatively correlated. Once again, I personally wouldn't use this graph unless it is for familiar/professional audience. It looks messy (not the footballer).


~Thanks,
Mihir

Comments