Box plots, also known as box and whisker diagrams, assist us in studying the distribution of the data and also provide us with information regarding the outliers. Box plots display the minimum, maximum, median, and interquartile range of each variable in the data. The Flowing Data website provides a very detailed description on how to read a box plot. The following plot shows the distribution and the outliers of wage data. We observe that as the level of education increases, the wage earned also increases.
Box plots are generated in R using the basic R package. The wage data used to generate the box plot is available with the ISLR
package and hence needs to be loaded in R. The following lines of code are used to load the package:
install.packages("ISLR") library("ISLR")