stats[statplots, boxplot]  Box Plot

Calling Sequence


stats[statplots, boxplot](data, , ...)
statplots[boxplot(data, , ...)
boxplot(data, , ...)


Parameters


data



statistical list(s)

shift=x



(optional, default=0) plot center shifted to x

width=w



(optional, default=1) width of the box plot

format=notched



optionally format as a notchedbox plot

plotargs



additional plot options





Description


•

The function boxplot of the subpackage stats[statplots, ...] gives a box plot summarizing the data in data.

•

A box plot comprises these elements:

 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 midday temperature over the period of one year by producing one boxplot per month, and displaying them side by side.

•

Notchedbox 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 boxplots is as a onedimensional summary that is inserted in the edge of a scatter plot.

•

Classes are assumed to be represented by the class mark, for example has the value . Missing data are ignored.

•

The command with(stats[statplots]) allows the use of the abbreviated form of this command.



Examples


Important: The stats package has been deprecated. Use the superseding package Statistics instead.
>


>


>


>


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 chisquare distribution with three degrees of freedom, whereas data5 comes from a Student's t distribution with three degrees of freedom.
>


>


>


>



