g01asf produces a specified number of box and whisker plots on a character printing device, with a chosen number of character positions in each direction.
The routine may be called by the names g01asf or nagf_stat_plot_box_whisker.
3Description
g01asf produces a series of box and whisker plots representing data batches each of size , for . A box and whisker plot is a diagrammatic representation of the five-point summary of a data batch. The plot consists of a box spanning the hinges with the median indicated by a third line and two whiskers to represent the extreme values. The five-point summary is calculated internally and is returned in the workspace array.
The plot is returned in the character array plot. The size of the plot may be controlled using the arguments nstepx and nstepy. Optionally the plot can be output to an external file, in which case output is directed to the current advisory message unit as defined by x04abf.
An axis corresponding to the axis is drawn and annotated and data points are plotted to the nearest character position.
4References
Erickson B H and Nosanchuk T A (1985) Understanding Data Open University Press, Milton Keynes
Tukey J W (1977) Exploratory Data Analysis Addison–Wesley
5Arguments
1: – Character(1)Input
On entry: indicates whether the box and whisker plot is to be output to an external file.
The box and whisker plot is not output to an external file.
The box and whisker plot is output to the current advisory message unit as defined by x04abf.
Constraint:
or .
2: – IntegerInput
On entry: , the number of data batches that are to be represented.
Constraint:
.
3: – Integer arrayInput
On entry: contains the number of observations in the th batch, , for .
If the th batch is omitted from the plot.
Constraint:
at least one must be greater than or equal to , for .
4: – Real (Kind=nag_wp) arrayInput
On entry: the th column of x must contain the data for the
th batch, that is must contain the th observation of the th batch, for and .
5: – IntegerInput
On entry: the first dimension of the array x and the dimension of the array iwork as declared in the (sub)program from which g01asf is called.
Constraint:
.
6: – IntegerInput
On entry: the number of character positions to be plotted in the -direction.
Constraint:
.
7: – IntegerInput
On entry: the number of character positions to be plotted in the -direction.
Constraint:
.
8: – Character(1) arrayOutput
On exit: contains the box and whisker plots.
9: – IntegerInput
On entry: the first dimension of the array plot as declared in the (sub)program from which g01asf is called.
Constraint:
.
10: – Real (Kind=nag_wp) arrayOutput
On exit: , for , contains the five-point summary of the th batch.
11: – Integer arrayWorkspace
12: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
On entry, at least one element of .
On entry, .
Constraint: .
On entry, is too small for plots.
On entry, .
Constraint: .
On entry, and .
Constraint: .
On entry, .
Constraint: or .
On entry, .
Constraint: .
On entry, all batches have .
On entry, the data values are all identical.
An unexpected error has been triggered by this routine. Please
contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
7Accuracy
If the range of observations in a particular batch is too small to allow each item of the five-point summary to be plotted separately, then a sequence of stars are plotted at the median point of the batch to indicate that the full box-plot could not be plotted.
8Parallelism and Performance
g01asf is not threaded in any implementation.
9Further Comments
The time taken by g01asf increases with and , for .
10Example
The following program produces a box and whisker plot for each one of data batches of sizes , , , and respectively and prints the box and whisker plots on the current advisory message unit.