I am reading a book by professor Trevor Hastie and professor Robert Tibshirani called "Introduction to Statistical Learning". In the applied section of the chapter 4, there is a question 11(b) that says:

Explore the data graphically in order to investigate the association between "mpg01" and the other features. Which of the other features seem most likely to be useful in predicting "mpg01"? Scatterplots and boxplots may be useful tools to answer this question. Describe your findings.

Here I tried plotting those box plots but how to find the useful features by analyzing them. enter image description here

I'm certain that from the correlation matrix and the scatter plots I can judge what all features could be useful, but how come a box-plot be used for that matter, could someone please share their opinion.


This is actually very simple: the more separation you see between the boxes, the stronger the 'predictive power' of the covariate.

Boxplots can be actually viewed as histograms looked at from the top. The box itself encompasses 50% of the data (from 25th to 75th percentile), and the line inside the box is the median. Whiskers show you the bounds of the data, up to 1.5 IQR (if I remember correctly). Anything over that range is an outlier.

Consider 2 plots: displacement and acceleration. In the displacement plot the boxes are completely separated, meaning that at least 50% of the data 'mass' is in a completely different place for mpg01='0' than for mpg01='1'. On the other hand, in acceleration the top of one box is around the median in another box - indicating poor separation.

| improve this answer | |
  • $\begingroup$ Thanks @Michal for answering my question, I understand that now. $\endgroup$ – Adarsh Namdev Oct 17 at 7:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.