PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_stat_5pt_summary (g01al)
Purpose
nag_stat_5pt_summary (g01al) calculates a five-point summary for a single sample.
Syntax
Description
nag_stat_5pt_summary (g01al) calculates the minimum, lower hinge, median, upper hinge and the maximum of a sample of observations.
The data consist of a single sample of observations denoted by and let , for , represent the sample observations sorted into ascending order.
Let if is even and if is odd,
and if is even and if is odd.
Then we have
Minimum |
, |
|
Maximum |
, |
|
Median |
|
if is odd, |
|
|
if is even, |
Lower hinge |
|
if is odd, |
|
|
if is even, |
Upper hinge |
|
if is odd, |
|
|
if is even. |
References
Erickson B H and Nosanchuk T A (1985) Understanding Data Open University Press, Milton Keynes
Tukey J W (1977) Exploratory Data Analysis Addison–Wesley
Parameters
Compulsory Input Parameters
- 1:
– double array
-
The sample observations, .
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the dimension of the array
x.
, number of observations in the sample.
Constraint:
.
Output Parameters
- 1:
– double array
-
res contains the five-point summary.
- The minimum.
- The lower hinge.
- The median.
- The upper hinge.
- The maximum.
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
The computations are stable.
Further Comments
The time taken by nag_stat_5pt_summary (g01al) is proportional to .
Example
This example calculates a five-point summary for a sample of observations.
Open in the MATLAB editor:
g01al_example
function g01al_example
fprintf('g01al example results\n\n');
x = [12 9 2 5 6 8 ...
2 7 3 1 11 10];
[res, ifail] = g01al(x);
fprintf('Maximum %14.4f\n', res(5));
fprintf('Upper Hinge (75%
fprintf('Median (50%
fprintf('Lower Hinge (25%
fprintf('Minimum %14.4f\n', res(1));
g01al example results
Maximum 12.0000
Upper Hinge (75% quantile) 9.5000
Median (50% quantile) 6.5000
Lower Hinge (25% quantile) 2.5000
Minimum 1.0000
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015