stats[statplots, boxplot](data, arg=value, ...)
statplots[boxplot(data, arg=value, ...)
boxplot(data, arg=value, ...)
(optional, default=0) plot center shifted to x
(optional, default=1) width of the box plot
optionally format as a notched-box plot
additional plot options
Important: The stats package has been deprecated. Use the superseding package Statistics instead.
The function boxplot of the subpackage stats[statplots, ...] gives a box plot summarizing the data in data.
A box plot comprises these elements:
1) A box with
- a central line showing the median,
- a lower line showing the first quartile,
- an upper line showing the third quartile;
2) Two lines extending from the central box of maximal length 3/2 the interquartile range but not extending past the range of the data;
3) Outliers, points that lie outside the extent of the previous elements.
Using the parameter format=notched will create a box plot with one additional feature. The sides of the box are indented, or notched, at the median line. This notch has a maximal width of 3.14 times the interquartile range divided by the square root of the total weight of the data. The notch is constrained inside the first and third quartiles.
When there is more than one statistical list in data, a box plot will be produced for each data set. Each box will be plotted on the same axes, side by side.
Box plots are quite useful to compare similar data sets. For example, one can quickly compare the monthly mid-day temperature over the period of one year by producing one boxplot per month, and displaying them side by side.
Notched-box plots can be used to determine if two random samples were drawn from the same population. If the notches of each plot overlap, it is acceptable to say that both data sets have the same distribution. However, overlapping notches do not guarantee that the data sets are identically distributed.
Another use of box-plots is as a one-dimensional summary that is inserted in the edge of a scatter plot.
Classes are assumed to be represented by the class mark, for example 10..12 has the value 11. Missing data are ignored.
The command with(stats[statplots]) allows the use of the abbreviated form of this command.
change axes to frame:
Usually, there are more than one box plot in a statistical plot. Two sets of data can be compared in this manner:
Plotting data1 versus data2 with box plots in the margin of a scatter plot:
One of the box plots above x=14
The other box plots above x=6
Flip that one so that it is now on its side, centered at y=6
Display the composite plot.
Examples of notched box plots (use the abbreviated command):
In the following plot, one could conclude that data3 and data4 are samples from the same population, and that data5 was drawn from a different population. This is exactly the situation, since data3 and data4 come from a random sample of a chi-square distribution with three degrees of freedom, whereas data5 comes from a Student's t distribution with three degrees of freedom.
Download Help Document
What kind of issue would you like to report? (Optional)