Library: | graphic |
See also: | dispdot plotbox |
Quantlet: | dispbox | |
Description: | Generates a standard boxplot. An optional factor allows multiple boxplots by group. |
Usage: | bp = dispbox(x {, factor}) | |
Input: | ||
x | n x 1 vector (continuous variable) | |
factor | n x 1 vector (discrete variable) | |
Output: | ||
bp | composed graphical object |
The whiskers designate the farest non-outliers above resp. below the box.
Outliers are all data at least 1.5 * (height of box) away from the upper resp. lower edge of the box. Outliers are plotted as circles.
If this distance exceeds 3 * (height of box), a star symbol is used ("gross outlier")
Requires the library "stats" to be present.;
IMPORTANT: The factor variable might be alphabetically reordered!
library("graphic") library("stats") x = normal(4000) m = matrix(1000) factor = m | 2*m | 3*m | 4*m bp1 = dispbox(x) bp2 = dispbox(x, factor) dd = createdisplay(1, 2) show(dd, 1, 1, bp1) show(dd, 1, 2, bp2)
Shows a boxplot of x on the left. On the right four boxplots of the four groups within x defined by factor are shown.