Module # 8 Correlation Analysis and ggplot2

 

Correlation/Regression Analysis using ggplot2 and Mtcars

1) This week we are going to create a our own visual analytics based on correlation or regression analysis using ggplot2. We will be using a grid to enhance the comparisons between scatter plot on our graphics. Here we go. 

2) We are going to be comparing MPG to other variables in the mtcars dataset. MPG to horsepower, MPG to weight, MPG to the rear axel ration or drat. We are going to do a correlation analysis and use visual regression lines for our graphic as well as some grid lines to make it easer to read. 








3) So what we have here are three scatterplots with regression lines done side by side for easy visualization. As we can see the general trend of the both the MPG to hp and MPG to weight is that the MPG tends to decrease as the hp or the weight goes up. This means that these variables are negatively correlated. Our third graphic however, indicates that MPG is positively correlated to rear axel ratio or drat. This means that the MPG tends to increase as the drat increases. 

4) Now, I actually based my graph's visual ascetic on Stephen Few's recommendations for how visuals should appear. I used light, unobtrusive grid lines that don’t overshadow the data. Limited color use to avoid cognitive overload and ensuring labels are clear and concise. Titles and axes were all labeled appropriately, and there is no unnecessary clutter. I think that Mr. Few would approve of my visuals. 


Comments