g01al calculates a five-point summary for a single sample.

Syntax

C#
public static void g01al(
	int n,
	double[] x,
	double[] res,
	out int ifail
)
Visual Basic
Public Shared Sub g01al ( _
	n As Integer, _
	x As Double(), _
	res As Double(), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void g01al(
	int n, 
	array<double>^ x, 
	array<double>^ res, 
	[OutAttribute] int% ifail
)
F#
static member g01al : 
        n : int * 
        x : float[] * 
        res : float[] * 
        ifail : int byref -> unit 

Parameters

n
Type: System..::..Int32
On entry: n, number of observations in the sample.
Constraint: n5.
x
Type: array<System..::..Double>[]()[][]
An array of size [n]
On entry: the sample observations, x1,x2,,xn.
res
Type: array<System..::..Double>[]()[][]
An array of size [5]
On exit: res contains the five-point summary.
res[0]
The minimum.
res[1]
The lower hinge.
res[2]
The median.
res[3]
The upper hinge.
res[4]
The maximum.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

g01al calculates the minimum, lower hinge, median, upper hinge and the maximum of a sample of n observations.
The data consist of a single sample of n observations denoted by xi and let zi, for i=1,2,,n, represent the sample observations sorted into ascending order.
Let m=n2 if n is even and n+12 if n is odd,
and k=m2 if m is even and m+12 if m is odd.
Then we have
Minimum=z1, 
Maximum=zn, 
Median=zmif n is odd,
 =zm+zm+12if n is even, 12
Lower hinge=zkif m is odd,
 =zk+zk+12if m is even, 12
Upper hinge=zn-k+1if m is odd,
 =zn-k+zn-k+12if m is even.12

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

Error Indicators and Warnings

Errors or warnings detected by the method:
ifail=1
On entry,n<5.
ifail=-9000
An error occured, see message report.
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

The computations are stable.

Parallelism and Performance

None.

Further Comments

The time taken by g01al is proportional to n.

Example

This example calculates a five-point summary for a sample of 12 observations.

Example program (C#): g01ale.cs

Example program data: g01ale.d

Example program results: g01ale.r

See Also