0% found this document useful (0 votes)
11 views

Box and Whisker Plot

Uploaded by

25fmczmtkm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Box and Whisker Plot

Uploaded by

25fmczmtkm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

BOX AND WHISKER PLOT

A box and whisker plot, also known as a box plot, is a


graphical representation of a set of numerical data that
provides a summary of its distribution. It displays the
minimum, first quartile, median, third quartile, and
maximum values of the data set, along with any outliers
or extreme values.
Key Components

 Minimum: The smallest value in the dataset, represented by a horizontal line .


 First Quartile (Q1): The median of the lower half of the dataset. It represents the 25th
percentile of the data and is denoted by the bottom edge of the box.
 Median (Q2): The middle value of the dataset. It represents the 50th percentile.
 Third Quartile (Q3): The median of the upper half of the dataset. It represents the 75th
percentile of the data.
 Maximum: The largest value in the dataset, excluding any outliers. It is represented by a
horizontal line extending to the right of the box plot.
 Interquartile Range (IQR): The range between the first quartile (Q1) and the third quartile
(Q3).
 Whiskers: Lines extending from the box represent the minimum and maximum values within
a specified range
Aspects

 Center: The position of the median line indicates the central


tendency of the data. If the median is closer to the lower quartile
(Q1), the data may be left-skewed, and if it is closer to the upper
quartile (Q3), the data may be right-skewed.
 Spread: The width of the box (IQR) represents the dispersion of
the data. A larger IQR indicates greater variability or spread in the
dataset.
 Outliers: Individual data points beyond the whiskers are
considered outliers.
 Comparisons: Box and whisker plots allow for visual
comparisons between different groups or datasets. You can
compare the positions of the medians, the spread of the boxes,
and the presence of outliers to understand variations between the
groups.
Here's an example of creating a box and whisker plot in R:

Boxplot in R code:
 In R, you can create a box
and whisker plot using the
box plot () function. The
box plot () function takes
one or more numeric vectors
as input and produces a box
and whisker plot
representing the distribution
of the data.
BOX PLOT

This code will generate a simple box and whisker plot for the
data vector
Create a box and whisker plot for multiple data vectors

Code: Multiple box plot


Stand-Alone box plot

When
creating a  A standalone plot in R refers to a plot that is
standalone generated and saved as a separate image file,
plot in R,
you rather than being displayed within the R
typically console or an interactive plotting window. It
save the plot allows you to save the plot as a static image that
as an image can be shared, printed, or used in external
file, such as documents or presentations.
PNG,
JPEG, PDF,
or SVG.
 we use boxplot(data) to create the box plot
on the screen.
 To save the plot as a standalone image file,
we use the png() function and specify the
file name ("boxplot.png" in this case), as
well as the width, height, and resolution of
the image. In the example, we set the width
to 800 pixels, height to 600 pixels, and
resolution to 300 pixels per inch (dpi).
Adjust these values as needed for your
specific requirements.
 After saving the plot, we use dev.off() to
close the graphics device and complete the
process.
 The resulting image file, "boxplot.png,"
will be saved in your working directory and
can be opened and viewed independently.
 You can choose other formats such as JPEG
(jpg), PDF (pdf), or SVG (svg) by
replacing "boxplot.png" with the desired
file name and extension in the png()
function.
Side-by-side box plot

 A side-by-side boxplot in R is a
graphical representation of the
distribution of numerical data across
multiple groups or categories. It  To create side-by-
allows you to compare the
distributions of different groups or side boxplot in R,
categories visually. In a side-by-side
boxplot, each group or category is
you can use the
represented by a box that displays boxplot () function
key statistical measures of the data
distribution, such as the median,
along with the par ()
quartiles, and any outliers. The function to configure
boxes are placed side by side,
making it easy to compare the the plot layout. Here's
distribution of each group. an example:
Side by side boxplot:
Code:

You might also like