-
CHAPTER 14 Quartiles, Deciles, Percentiles, and Boxplots
Here is our homerun data set:
35 26 46 24 24 22 35 54 12 25 16 26 11 31 16 28 17 20 25 18 20
27 17 0 12 24 16 31 7 6 25 20 20 21 23 7 7 7 12 21
If I sort this data set, it looks like this:
0 6 7 7 7 7 11 12 12 12 16 16 16 17 17 18 20 20 20 20 21 21 22
23 24 24 24 25 25 25 26 26 27 28 31 31 35 35 46 54
The first quartile of this data set is the number that has
approximately 25% of the data to its left. In R, it can be obtained
by typing
quantile(homeruns, .25).
Similarly, the second quartile is the number that has
approximately 50% of the data to its left, and the third quartile
is the number that has approximately 75% of the data to its left.
In R, each can be obtained, respectively, by typing
quantile(homeruns, .50) and quantile(homeruns, .75).
Statistics E-text 1
-
Quartiles, Deciles, Percentiles, and Boxplots
2
If you would like to quickly compute all three quartiles at
once, type
quantile(homeruns).
This produces the following output:
0% 25% 50% 75% 100%
0.00 15.00 20.50 25.25 54.00
The middle three numbers are the quartiles.
Deciles divide the data set into ten pieces. The 3rd decile, for
instance, is the num-ber that has 30% of the data to its left. It
can be obtained by typing
quantile(homeruns, .30).
Similarly, the 8thdecile, for instance, can be obtained by
typing
quantile(homeruns, .80).
Finally, percentiles divide the data set into one hundred
pieces. The 30th percentile, for instance, is the number that has
30% of the data to its left. It can be obtained by typing
quantile(homeruns, .30).
Similarly, the 5th percentile, for instance, is the number that
has 5% of the data to its left, and it can be obtained by
typing
quantile(homeruns, .05).
There is a type of graph associated with the quartiles. It is
called a boxplot. To generate a boxplot in R, type
boxplot(homeruns).
In R the following output is generated:
Statistics E-text
-
The bottom edge of the box is located at the first quartile, the
middle line inside the box is located at the second quartile, and
the top edge of the box is located at the third quartile. The dots
that you see plotted above represent outliers. The exten-sions of
the plot go out to the largest and smallest data values which are
not outli-ers.
Here is a video tutorial:
Statistics E-text 3
-
Quartiles, Deciles, Percentiles, and Boxplots
4
Statistics E-text
CHAPTER 14 Quartiles, Deciles, Percentiles, and Boxplots