Note: before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.
G02BAF computes means and standard deviations of variables, sums of squares and cross-products of deviations from means, and Pearson product-moment correlation coefficients for a set of data.
On exit: is the product-moment correlation coefficient between the th and th variables, for and .
10: LDR – INTEGERInput
On entry: the first dimension of the array R as declared in the (sub)program from which G02BAF is called.
Constraint:
.
11: IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to , . If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value is recommended. If the output of error messages is undesirable, then the value is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is . When the value 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).
6 Error 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,
.
On entry,
.
On entry,
,
or
,
or
.
7 Accuracy
G02BAF does not use additional precision arithmetic for the accumulation of scalar products, so there may be a loss of significant figures for large .
8 Further Comments
The time taken by G02BAF depends on and .
The routine uses a two-pass algorithm.
9 Example
This example reads in a set of data consisting of five observations on each of three variables. The means, standard deviations, sums of squares and cross-products of deviations from means, and Pearson product-moment correlation coefficients for all three variables are then calculated and printed.