Understanding Box Plots: A Complete Guide with Examples

Slide Note
Embed
Share

Box plots, also known as whisker plots, are an effective way to visually represent numerical data by depicting quartiles, median values, and outliers. They offer a compact display of information, making it easy to compare samples and analyze the symmetry of data. This article covers the basics of box plots, their uses, customization options in R, and provides examples using vectors and numeric columns of a data frame.


Uploaded on Jul 19, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. BOX PLOTTING Sarmistha Sutar College Roll No. : MAT/19/69 University Roll No. : 19044563024

  2. WHAT IS BOX PLOT? WHAT IS BOX PLOT? Boxplot also known as Whisker Box Plot is a method for graphically depicting groups of numerical data through their quartiles. A box plot presents a lot of information in a complete and compact manner. Basic form of boxplot shows median value, the quartiles and the maximium / minimum values. boxplot() command is used to form a boxplot in R. Simple or multiple vectors and numeric columns of a data frame can be used to form box plot.

  3. USES OF BOX PLOT USES OF BOX PLOT Box plot is used to visualise complex data where you have multiple data sets. It is useful for comparing samples. We can form a boxplot for a single sample or for multiple samples. The box-whisker plot is also useful to visualize a single sample because you can show outliers if you choose. It is often used in explanatory data analysis. It is used to analyse Symmetry of Data.

  4. CUSTOMIZATION OF BOXPLOT IN R CUSTOMIZATION OF BOXPLOT IN R We can customize and enhance the appearance of box plot by using following commands :- names : to set the labels of boxplots which are by default 1 and 2. xlab : to label or give title to x-axis. ylab : to label or give title to y-axis. range=0 : to extend the whiskers to maximum and minimum value. col : to give colour to boxplot. main : to give title to the boxplot horizontal=TRUE : for horizontal box plots.

  5. EXAMPLES OF BOX PLOT EXAMPLES OF BOX PLOT Boxplot using vectors :- We are given the following data: Red: 5, 4, 3, 6, 8, 7, 9, 0, 2, 4, 5 ; Pink: 3, 2, 4, 5, 6, 7, 2, 3, 4, 2, 4 ; Create boxplot for these 2 vectors. Do not give main title. And give names to the 2 components as x and y. Command : Red<-c(5,4,3,6,8,7,9,0,2,4,5) Pink<-c(3,2,4,5,6,7,2,3,4,2,4) boxplot(Red,Pink,name=c('x','y )) Output :

  6. EXAMPLES OF BOX PLOT EXAMPLES OF BOX PLOT Boxplot using numeric columns of data frame :- Consider mtcars inbuilt data set. Draw boxplot for mpg and cyl columns. Give suitable customizations. Command : boxplot(mtcars$mpg,mtcars$cyl,main='Mileage Data , xlab='Number of Cylinders',ylab='Miles per Gallon ,col=c('green','yellow'),names=c('high','low )) Output :

  7. THANK YOU!

Related